kgasman Posted September 28, 2017 Posted September 28, 2017 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
comment Posted September 28, 2017 Posted September 28, 2017 4 minutes ago, kgasman said: After upgrading to Filemaker Pro 16, the AppleScript no longer sets the Filemaker Pro Field Anyone have any ideas why? Because of FMP 16 enhanced security. See the first one of "Tips on usage" here: http://www.filemaker.com/help/16/fmp/en/index.html#page/FMP_Help/perform-applescript-os-x.html
Lee Smith Posted September 28, 2017 Posted September 28, 2017 Hi kgasman, I posted an example of where FileMaker has changed this, - here https://fmforums.com/topic/101881-using-applescript-to-open-a-scriptwindow/?tab=comments#comment-463843
kgasman Posted September 29, 2017 Author Posted September 29, 2017 Thank you I did set the privileges as you suggested and the AppleScript still does not set the Field... very strange
kgasman Posted February 5, 2018 Author Posted February 5, 2018 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
Recommended Posts
This topic is 2872 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 accountSign in
Already have an account? Sign in here.
Sign In Now