Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Run Applescript - No Fun

Featured Replies

  • 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.

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 by Guest

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.