July 2, 200718 yr Newbies I'm trying to run a simple applescript which will open a FileMaker database and run a script. When the script runs, it opens the FileMaker database and displays the following message with the "do script" line highlighed "FileMaker Pro got an error: Object not found." tell application "FileMaker Pro" activate open file "RemoteHD:Nightly.fp7" do script FileMaker script "Test" end tell I've tried a number of variations such as: - Shorten the script line to 'do script "Test"' - insert before the "do script" line: database "Nightly" For debugging, I've tried to make the script as simple as possible. Thanks for your help.
July 2, 200718 yr Because FileMaker 7 introduced multiple windows you sometimes have to be more explicit in terms of your object references. do script FileMaker script "Script Name" of database "Database.fp7" Otherwise, FileMaker doesn't know which (of potentially all the databases that could be opened) script to run in which database. Also of note is the situation where running an AppleScript within FileMaker does not require the tell statement. Because the script is run from within FileMaker the concept of self or me (in AppleScript speak) takes effect. So you can get away with just this part within an AppleScript do script FileMaker script "Script Name" of database "Database.fp7" Nothing else is needed except the open - and if you're using one FileMaker file to open another then you should just use an Open File script step. If you're running the AppleScript from something like cron then "yes" you need all the other stuff - including the tell statements. Unless you need something more dynamic, then any extra steps in AppleScript could just slow down the whole process. Although in this case it would be negligible. If you're looking for more information about launching scripts automatically then I have two great articles at my site. One deals with OS based launching and the other uses freely available plug-ins. Scheduling Scripts (and Backups too!) http://www.filemakermagazine.com/articles/scheduling-scripts-and-backups-too.html Scheduling Scripts - Automating The Process http://www.filemakermagazine.com/videos/scheduling-scripts-automating-the-process.html Edited July 2, 200718 yr by Guest
Create an account or sign in to comment