Skip to content

Instantly share code, notes, and snippets.

@uchcode
Created March 13, 2016 17:47
Show Gist options
  • Save uchcode/38e5e5ec83c9249234b5 to your computer and use it in GitHub Desktop.
Save uchcode/38e5e5ec83c9249234b5 to your computer and use it in GitHub Desktop.
JavaScript for Automation (JXA) Arguments example.
#!/usr/bin/osascript -l JavaScript
ObjC.import('Foundation')
const argv = $.NSProcessInfo.processInfo.arguments.js
argv.forEach(function(arg, idx) {
if( idx < 4 ) return
console.log( arg.js )
})
function run(argv) {
argv.forEach(function(arg, idx) {
console.log( arg )
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment