KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Using LAUNCH EXTERNAL PROCESS to launch Applescripts
PRODUCT: 4D | VERSION: 2004.5 | PLATFORM: Mac OS X
Published On: March 7, 2007

To execute a plain text or compiled Applescript script (.scpt) in the method LAUNCH EXTERNAL PROCESS, make sure to call the OSASCRIPT command. An example:


LAUNCH EXTERNAL PROCESS("osascript /Applications/AppleScript/Example\ Scripts/Basics/AppleScript\ Website.scpt")


4D treats the execution of shells and apps as if they were executed from the Terminal, and the OSASCRIPT command is necessary to run an Applescript through the Terminal:

https://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptX/Concepts/work_with_as.html