Extended hs.osascript with functions to execute as/js from a file#1616
Closed
rkalis wants to merge 1 commit into
Closed
Extended hs.osascript with functions to execute as/js from a file#1616rkalis wants to merge 1 commit into
rkalis wants to merge 1 commit into
Conversation
…mFile functions, which import apple/javascript from a file, and exefcute it using the existing osascript functions
stickler-ci
reviewed
Dec 8, 2017
| --- 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 |
There was a problem hiding this comment.
(W631) line is too long (123 > 120)
| --- | ||
| --- 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. |
There was a problem hiding this comment.
(W631) line is too long (196 > 120)
| --- 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 |
There was a problem hiding this comment.
(W631) line is too long (123 > 120)
| --- | ||
| --- Notes: | ||
| --- * This function uses hs.osascript.javascript for execution. | ||
| --- * Use hs.osascript._osascript(source, "JavaScript") 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. |
There was a problem hiding this comment.
(W631) line is too long (195 > 120)
Member
|
@rkalis please ignore the stickler-ci comments for now - we've only just enabled it and I'm still bedding it down as to what is reasonable :) |
Contributor
Author
|
@cmsj Aah good to know, I was confused already, as some of the new lines of documentation (like the returns) were exactly the same as some existing ones 😅😅 |
Member
|
Thanks! 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows people to import an AppleScript file to execute, instead of writing it inline in a Lua file. This also makes it easier to debug these scripts before integrating it with Hammerspoon as the files can be run separately first.