1 Reply Latest reply on Feb 16, 2015 9:11 PM by bigtom

    Applescript not working on the FMServer



      Applescript not working on the FMServer

      Your post

      I have added an Applescript that opens files in Photoshop and counts the number of paths. It then adds this data to a Filemaker record. The script is called from inside a Filemaker script. The script works when I open the database from my desktop but will not run when the file is hosted on the FM server.

      This is the part that fails with the error (Filemaker Pro Advanced got and error: Object not found):

              tell application "FileMaker Pro Advanced"
                  go to layout "Item List"
                  set myRecord to (ID of (create new record))
                  set myID to cell "Purchase Orders::g_WO_Num" of layout "ItemListEntry"
                  set cell "ItemList::k_ID_WO_ItemList" of record ID myRecord to myID
                  set cell "NumPaths" of record ID myRecord to numOfPaths
                  set cell "ItemList::Item" of record ID myRecord to fileName
                  set cell "ItemList::Path" of record ID myRecord to filePath
                  go to layout "Item List"
              end tell

      The script creates a new record, but no data is entered.


        • 1. Re: Applescript not working on the FMServer

          If you are trying to run this as a scheduled script on FMS it will not work. There is no AppleScript support in FMS.

          It seems you are saying that the script runs when the database is local to your desktop or hosted from your desktop but not when hosted on the server.

          Have you tried debugging with AppleScript Editor? How far does it get? you may want to try using "of current record to" in place of "of record ID myRecord to"

          or for example with quoted for of:    set cell "ItemList::Path" of current record to quoted form of filePath

          Is there a reason you are navigating layouts in AS instead of FM? Possibly to loop though the PS routine?

          You may want to include:       tell layout "ItemList" of window "WindowName"

          I would guess the object it cannot find is on the ItemListEntry layout since you are on the ItemList layout. I am not an AS expert though.