dimanche 25 janvier 2015

How to use AppleScript application with "open file -a AppleScriptApp"?


Consider this applescript code:



on run argv
if (count of argv) > 0 then
-- do something with argv
-- like log to file
return "defined"
else
return "failed"
end if
end run


When I run it from terminal with passing some arguments, everything works. But when I export it as application and then trying to use it as follows:



$ open ~/some_file -a my_applescript_application


It looks like the whole script is not running. I see application running, but it looks like argv is empty.


So actually I want to pass the file path to my script using open ~/some_file -a my_applescript_application call.





Aucun commentaire:

Enregistrer un commentaire