Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script)
Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script)
- Subject: Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script)
- From: Philip Aker <email@hidden>
- Date: Sat, 21 Oct 2006 04:51:51 -0700
On 2006-10-18, at 10:00:52, Christopher Nebel wrote:
On 2006-10-15, at 07:44:19, Hiroshi T. wrote:
I wrote an Applescript to convert music file format in iTunes.
There are many options for conversion and currently the script
asks every option in the 'display dialog'. Some of these options
are of frequent use and I want to do them by one click. My
envisioned solution to implement this mechanism is to make
symbolic links to the script and call them in the 'iTunes Script
Menu'. For this to work, I need '$0'-equivalent in Applescript.
Namely, the script is to obtain the name of file off which it is
launched and changes what it does according to the file name.
I'd tell you to use "path to me", but it won't do what you want --
at least not currently. The problem is that the symlink gets
resolved before running the script, so they'll all come out
pointing to the original.
The problem with Philip's solution, at least as written, is that
you wind up with lots of identical copies of the base HiroConvert
application.
I certainly didn't intend that to be the implementation.
This is not hard to work around, though -- just put HiroConvert
somewhere outside the scripts.
You may have to manually find it once for the scripts to work, but
after that they should be fine. This is less than ideal for
distribution, but for your own personal use it doesn't matter much.
I think it could be anywhere if he gives it a CFBundleIdentifier
value in the Info.plist and then launches it by that method.
It would be nice if Script Editor had a few plist key entry options
for bundles in it's Bundle Contents Drawer.
Philip Aker
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden