Jump to content
Server Maintenance This Week. ×

Perform AppleScript and Filemaker Pro 16


This topic is 2273 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello

The following AppleScript is in a opening "Perform AppleScript" step in my database. In Filemaker Pro 13 this script set the Filemaker Pro field without out a problem.

After upgrading to Filemaker Pro 16, the AppleScript no longer sets the Filemaker Pro Field

Anyone have any ideas why?

here is the AppleScript:

--Make sure QuickTime exists; could be used to find any program

if (do shell script "ls /Applications") contains "QuickTime Player" then     

--send information to FileMaker so opening script can set voicenotes properly     

tell application "FileMaker Pro Advanced"         

tell table "Preferences"             

tell record 1                 

set cell "ToBurnSound" to "QuickTime Player"             

end tell         

end tell     

end tell     

end if

Link to comment
Share on other sites

  • 4 months later...

From a thread in Filemaker Community:

 

Just as a follow-up to document things for future readers of this thread:

  • As HOnza noted, the techniques described earlier in the thread require that fmextscriptaccess be turned on for the file in question when using FileMaker 16 (File > Manage > Security, grant extended privileges to selected users).
  • As I found out (and confirmed through implementation) in another thread, you may omit the 'tell Application "FileMaker Advanced"' tell block and just use the commands directly, since you are operating in the FileMaker context if your AppleScript is being run within FileMaker. This also avoids the problem where you don't know whether users will be running Pro or Advanced.

 

So you can simplify TSuki's AppleScript even more:

Tell application "Finder"
     set cap to get capacity of startup disk 
end tell

set cell "Field1" of current record to cap

 

It turns out if I modified my script to

if (do shell script "ls /Applications") contains "QuickTime Player" then

Set A to "QuickTime Player"

end if

set cell "ToBurnSound" to A

 

this works perfectly even if I don't set privileges or use a Tell command 

 

 

 

Link to comment
Share on other sites

This topic is 2273 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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