Hi
Does anyone have any experience using AppleScript to launch FileMaker Pro (17) built in scripts?
I have a script within Filemaker that imports an XML file when a button is pushed. But I am trying to get AppleScript this automate so that a dropped file can launch the same Filemaker script instead.
The trouble is AppleScript does not wait for the Filemaker script to complete before proceeding to the next command.
I can get around it by a simple delay step…
tell application "FileMaker Pro Advanced"
activate
tell database "Test DB for Peter XML script.fmp12"
tell current layout
tell current record
do script "XML Import"
delay 5
end tell
end tell
end tell
end tell
But this only works if there is no delay longer than 5 seconds and does not allow for any user interactions with the database before proceeding.
I have also tried inserting a field within Filemaker that the Filemaker script sets to “yes” when it is finished…
tell application "FileMaker Pro Advanced"
activate
tell database "Test DB for Peter XML script.fmp12"
tell current layout
tell current record
do script "XML Import"
repeat
if cellValue of cell "Has XML Imported" is "Yes" then exit repeat
end repeat
end tell
end tell
end tell
end tell
But this errors with “Error: -10011. Data is being accessed by another user, script, or transaction.” because Filemaker is still processing when AppleScript tries to access it.
Is there a way to pause the AppleScript until such time that it is prompted to continue by Filemaker?
Any help or ideas would be appreciated
Thanks
Tim