Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script)



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: http://lists.apple.com/mailman/options/applescript-users/email@hidden Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script) (From: "Hiroshi T." <email@hidden>)
 >Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script) (From: Philip Aker <email@hidden>)
 >Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script) (From: "Hiroshi T." <email@hidden>)
 >Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script) (From: Philip Aker <email@hidden>)
 >Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script) (From: "Hiroshi T." <email@hidden>)
 >Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script) (From: Philip Aker <email@hidden>)
 >Re: Comprehensive Applescript Reference Book (Re: Applescript equivalent of $0 in shell script) (From: Christopher Nebel <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.