sindresorhus / run-applescript

Run AppleScript and get the result
MIT License
140 stars 15 forks source link

Added functions to run scripts without -e parameter #5

Closed AngryKiller closed 6 years ago

AngryKiller commented 6 years ago

Useful for support with scripts using libs like applescript-json.

sindresorhus commented 6 years ago

How would you use this new API? It's not clear how it solves the problem?

AngryKiller commented 6 years ago

applescript-json needs to be compiled to run correctly, if you just execute the code, there will be errors.

sindresorhus commented 6 years ago

That is contradictive to its readme:

Alternatively, just copy/paste the contents of json.applescript into your own script, and use it straight away.

AngryKiller commented 6 years ago

Yeah, but then, if you run your script with the content of json.applescript pasted with the -e parameter, you will get errors and it will not work ;)

AngryKiller commented 6 years ago

Oh, and it can also be used to run scripts that are already compiled.

AngryKiller commented 6 years ago

Hi, do you need anything else to merge?

sindresorhus commented 6 years ago

Ok, I understand now. I was confused by your incorrect use of parameter names. Without -e it's actually a file path, not a script. The methods should be named .file() and .fileSync() and needs some tests too.