Re: Martin's Package-Opening Script
Re: Martin's Package-Opening Script
- Subject: Re: Martin's Package-Opening Script
- From: Daniel Jalkut <email@hidden>
- Date: Tue, 31 May 2005 10:09:31 -0700
As an aside to this - I've noticed that (starting in Tiger?) the
"such and such item's folder" command seems smarter. For instance,
if you ask the Finder for the folder of a .app application, it
returns the bundle's Contents folder.
It also seems to work on Frameworks, though unfortunately, in that
case it gives the "Versions" folder when I think it should just give
you the root of the bundle.
Daniel
On May 31, 2005, at 6:11 AM, Jonathan Levi, M.D. wrote:
It's very nice -- opens packages of type .mbox, .bundle, .pkg -- in
short, probably any package file with a suffix.
Except for application packages -- not the original subject,
admittedly, but why not include them, too? But a slight
modification of Martin's script solves this:
set foo to choose file
tell application "Finder"
--following string conversion could also be to Unicode text
if (foo as string) ends with ".app:" then
open alias ((foo as string) & "Contents:")
else
set bar to name of foo
set myName to my killExt(bar)
set name of foo to myName
open foo
set name of foo to bar
end if
end tell
on killExt(x)
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to "."
return word 1 of x
set AppleScript's text item delimiters to oldDelims
end killExt
It still doesn't work with .nib packages, because because choose
file stops at the nib's application. Perhaps the "default location"
option of choose file may help
Jonathan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (Applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
40red-sweater.com
This email sent to 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:
This email sent to email@hidden