yknot Posted March 18, 2008 Posted March 18, 2008 Hi, Is there any way by which I can pass a filemaker variable to an applescript which is running as part of the filemaker script? Thanks folks, yknot
Søren Dyhr Posted March 18, 2008 Posted March 18, 2008 Yes, since the call of an applescript not have to be a compiled external file, but instead a result of a calc'field. Another option is to write your own event's and call them from the Send Event instead, and exploit this: http://www.filemakermagazine.com/articles/learning-applescript.html-0 ...if still works?, I haven't tried the approach, since the way of writing the script dynamic inside a calc'field is pretty convenient. Despite the vast number of possibilities would I always seek to do matters as native as possible, perhaps if you could give us an example of what you wish to obtain by the hybridization you pursues? --sd
yknot Posted March 18, 2008 Author Posted March 18, 2008 Thanks for the reply. I am aware of the "set theName to cell "Name" of current record". But that means I have to park a variable in a cell/field first. I would like to simplify this: Filemaker: set variable $Name to "Jim" Applescript: set theName to $Name Possible??? Thanks, yknot
Fenton Posted March 18, 2008 Posted March 18, 2008 No. There is no support for variables in the FileMaker Perform AppleScript step, unless it is within a FileMaker calculation. In other words, it's an internal FileMaker object which the FileMaker AppleScript dictionary cannot see. But FileMaker can process it and return its value if the whole thing is within a calculation; because then only its value is returned. So, either you have to put the whole AppleScript within a FileMaker calculation, or you have to use a global field.
Newbies Zeyhra Posted March 26, 2011 Newbies Posted March 26, 2011 I have a similar issue/problem/question... I have a calculated script in FileMaker 11 Advanced: property theImg : {} tell application "Image Events" set theImg to open alias "H-DSpudConte38374S.jpg" of folder "H-D_Spud_Contest" of folder "04" of folder "2011" of folder "biker_events_rallies" of folder "Articles" of folder "WEB-TPI-LiveSite" of disk "MothraShare" set imgInfo to dimensions of theImg as text close theImg end tell imgInfo --> {dimensions:{981.0, 922.0}} tell application "FileMaker Pro Advanced" set cell "ImageDimensions" of current record to imgInfo end tell the image name and file path are all calculated on a per record basis and it runs on a loop through a series of records... It works great... some of the time... but periodically, I get an error -2753 "The variable is not defined. (-2753)" except that the variable IS defined globally in the line "property theImg : {}" I've occasionally gotten the same error when testing the exact same script through Applescript (as in copy/paste from a calculation field in FileMaker getting the exact info the script would receive as it runs through its loop), but if I quit Applescript and relaunch it and paste the same script into a new script window it will run fine. Because of this I'm not sure if it's a FileMaker issue, an Applescript issue, or even possibly an issue with my computer itself... any input would be MUCH appreciated! Thanks Zeyhra 2(Mac Mini OSX 10.5.8 with FileMaker Pro 11) + Mac Mini OSX 10.5.8 with FileMaker Pro Advanced 11 + Mac Mini OSX Server 10.6.7 with FileMaker Server Advanced 11
Recommended Posts
This topic is 4995 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