Signature |
hs.osascript.applescriptFromFile(fileName) -> bool, object, descriptor |
Type |
Function |
Description |
Runs AppleScript code from a source file. |
Parameters |
- fileName - A string containing the file name of an AppleScript file to execute.
|
Returns |
- A boolean value indicating whether the code succeeded or not
- An object containing the parsed output that can be any type, or nil if unsuccessful
- If the code succeeded, the raw output of the code string. If the code failed, a table containing an error dictionary
|
Notes |
- This function uses hs.osascript.applescript for execution.
- Use hs.osascript._osascript(source, "AppleScript") if you always want the result as a string, even when a failure occurs. However, this function can only take a string, and not a file name.
|
Source |
extensions/osascript/init.lua |