Tags:
script, shell, extension, application, association
Ok,
I have a plugin for Quicktime to play another file format. I want to associate the file format (.xxx for arguments sake) with quicktime now that it can play these files. Note that this will all be packaged into an installer to be distributed on any Tiger system.
So, after flirting with all sorts of fancy things I came to the conclusion that I'd have to create my own application bundle which contains a shell script which runs an applescript which tells Quicktime to open the applicable file. Then I specify in the apllication bundle's Info.plist that I want .xxx files associated with it.
This all works fine except I have no idea where to get the filename of the file I have double clicked.
So I basically have a shell script in MyApp.app/Contents/MacOS/shellscript.sh
QUESTION 1: What do I call in shellscript.sh to get the filename of the *.xxx file that I have double-clicked?
Now, my shellscript basically just does this:
osascript as.scpt "$1"
currently the $1 gives one gives something like this -psn_0_123456 and there are no more arguments.
so if there is no answer for QUESTION1...
QUESTION 2: Can I find the calling *.xxx file from the applescript?
Running the shell script from the command line works perfectly BTW so I know the applescript is correct, I just need to be able to find the filename out somehow!