MogensBrun Posted January 12, 2010 Posted January 12, 2010 Hello, I am trying to execute an AppleScript using a Shell command (via Troi File), because the "Perform AppleScript" command in ScriptManager is not server compliant. While I can execute other Shell commands I can't get 'osascript ' to work in a server script. It works as expected in a client script. Has anybody got success with calling AppleScript from a server script? Regards, Mogens
Søren Dyhr Posted January 13, 2010 Posted January 13, 2010 What you might have hit here is that the clients object model for fms is nowhere the same as fm in client version. You can indeed call an applescript but would need to address a client version, if the task deals with inner database matters. The easiest way to investigate what is possible and what isn't is to open what in the applescript script editor is called "ordbog" in danish ... and as I recall it is it pretty much down simple housekeeping when speaking of fms getting nowhere near tables, fields layouts and scripts. --sd
MogensBrun Posted January 13, 2010 Author Posted January 13, 2010 Hi Søren, The first problem is to execute an AppleScript from a FMS server script. As stated above the script step "Perform AppleScript" can't be used in a server script. So a possible solution is to activate an AppleScript by using a shell command like 'osascript '. But even this roundabout will not start the AppleScript. I have checked that owner, group and permission for the AppleScript is set correctly to allow FileMaker Server to execute the Applescript. So the inability to execute AppleScript may be found elsewhere. If I could activate an AppleScript from FMS, the next problems would be to pass parameters between the FMS script and AppleScript, but these could be solved by writing parameters to a temporary file. Actuyally 'osascript' does now allow for sending parameters from a Shell command to Applescript. Regards, Mogens
Søren Dyhr Posted January 14, 2010 Posted January 14, 2010 Yes it's pretty obvious to me that any manipulation according to the object model only deals with the client version, due to the lack of other interface than the fmnet protocol, IWP/CWP or ODBC. Couldn't you reaveal what your script does? Then would I like to turn your attention to these two URLs: http://www.macosxhints.com/article.php?story=20040617170055379 http://stackoverflow.com/questions/1792800/can-applescript-take-output-of-shell-script-and-put-in-paste-buffer Which should give you some answers, try an embed an applescript which shows a dialog, just for the testing purpose. --sd
Recommended Posts
This topic is 5797 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