Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Various strange hacks and cool stuff.
Suppressing osascript's Last Statement Result
As mentioned in Invoking JXA from Shell Scripts section,
osascript will print the result of the last statement that is run. You can end your script with
void 0 to force last statement to have undefined value. However, a blank line will be printed instead.
Sometimes this is unwanted. You can just tell the
osascript process to
osascript supports reading scripts from standard input. That means you can compile CoffeeScript and pipe it into osascript.
Here is an example script that renames selected files in Finder — changes
for file in Application('Finder').selection() file.name = file.name().replace '@2x', '_2x'
The sections about importing other scripts have been moved to Importing Scripts.