Do not use on any
shared computer
July 25, 2008 12:03am pdt
null
[x]
Attachment Details

Application Bundles/Extension association/Shell Script/Obtain double-click filename

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!
Start your free trial to view this solution
Question Stats
Zone: Apple
Question Asked By: keteracel
Question Asked On: 10.18.2007
Participating Experts: 2
Points: 500
Views: 0
Translate:
Loading Advertisement...
 
[+][-]Expert Comment by ahoffmann
Expert Comment by ahoffmann:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by RaddishIoW
Expert Comment by RaddishIoW:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by keteracel
Author Comment by keteracel:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by RaddishIoW
Expert Comment by RaddishIoW:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by keteracel
Author Comment by keteracel:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by keteracel
Author Comment by keteracel:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by RaddishIoW
Expert Comment by RaddishIoW:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628