March 24, 200916 yr I cannot make FileMaker Server 9 execute system-level scripts (Mac OS X). The scripts run fine from terminal. For example, I create a file called "test1.sh" with the contents: #! /bin/sh osascript -e 'tell application "Safari"' -e 'activate' -e 'end tell' When I run the above from the FileMaker Server Scheduler - nothing happens. When I check logs - I see in the console log the following error: osascript: kCGErrorRangeCheck : Window Server communications from outside of session allowed for root and console user only In the FileMaker Server log, file "stderr" INIT_Processeses(), could not establish the default connection to the WindowServer./Library/FileMaker Server/Data/Scripts/test1.sh: line 2: 15412 Abort trap osascript -e 'tell application "Safari"' -e 'activate' -e 'end tell' Any ideas? Thanks
March 27, 200916 yr First of all, you've got a space on line #1 after the exclamation point. But that probably won't stop your script from executing. There are some limitations to using the osascript command from the Terminal. You might want to take a look at this to get some insight: http://macscripter.net/viewtopic.php?id=26334 But I think the main problem is that the script will be running as the "user" fmserver, which is a non-GUI account. You could probably use something like the sudo command to "switch" the terminal session to the logged in user account and execute your script from there. Simon. Edited March 27, 200916 yr by Guest
Create an account or sign in to comment