Monday, October 26, 2020

#1 2020-10-10 10:01:13 am

Amelie
Member
Registered: 2020-03-30
Posts: 13

Applescript to find records in table

I have an Filemaker Database with a table called "FactuurSchijven". De table contains the field "Facuurnummer". Now, I'm trying to find all the record of my table, where the cell is "Facuurnummer" is equal to "2019-0-266".

For now, I have the following code:

Applescript:

tell application "FileMaker Pro Advanced"
   tell table "FactuurSchijven"
       show every record
       show (every record whose cell "Factuurnummer" is "12019-0-266")
   end tell
end tell

I always get the error code -1708, the event doesn't work.

I tried already a lot of things, but none of them worked. Can someone help le?

Offline

 

#2 2020-10-10 03:10:40 pm

Bernamo
Member
Registered: 2015-08-25
Posts: 4

Re: Applescript to find records in table

It’s working fine for me (even without your first «  show every record » line).

The latest FMP versions modified the application name, deleting « Advanced ».
please try with tell application "FileMaker Pro" ( zonder Advanced smile )

BM

Offline

 

#3 2020-10-11 12:46:31 am

Amelie
Member
Registered: 2020-03-30
Posts: 13

Re: Applescript to find records in table

It still doesn't work. When I delete the advanced,  mijn Scripteditor asks me where he can find Filemaker and he puts back the advanced. I'm working with FM version 16.


My big problem, I want to solve is the following: based on some record in the table, I want to make a numbers file. There. are two options I can do:

1. Search the records in FM and then with AppleScript make the file in numbers and fill in the fields of the records. Searching in FM is no problem, but with AppleScript I get always the whole table with all the records. I use "tell current table" ...

2. The other way is, do the search Applescript en then sort the record I found. But my AppleScript doen't do the sort.

Offline

 

#4 2020-10-13 03:05:21 am

Amelie
Member
Registered: 2020-03-30
Posts: 13

Re: Applescript to find records in table

I have figured it out. The correct code is:

Applescript:

tell application "FileMaker Pro Advanced"
   tell window 1
       go to layout "Factuurschijven"
       show (every record whose cell "Factuurnummer" = "2019-0-266")
       set n to (count records of layout "Factuurschijven")
       display dialog n
   end tell
end tell

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)