Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Executing AppleScript from server script

Featured Replies

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

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

  • Author

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

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

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.