I am packaging an application into a .app directory for "drag install" or whatever it's called and I have a weird iessue with file association. I set my application as a viewer for .xyz files, and the system does start my app when I double click that file; the only problem is that the path of the file I clicked is nowhere in the args[], there's only one parameter that is something like ~psn_0_901340 and I think is a timestamp because it changes every time.
So... what am I supposed to do? I've been sitting here for 2 hours straight and can't find a solution.
I think what you want is an AppleScript droplet.
A shortened version of the AppleScript from that link:
Export as an application using
Script Editor
. Placescript.sh
in theResources
folder.Add your file extension associations to
Info.plist
. You may need to launch or move the droplet before OS X notices the change & allows you to double-click files.If you want to launch Terminal or capture the script output, see the full AppleScript.