Martin's Package-Opening Script
Martin's Package-Opening Script
- Subject: Martin's Package-Opening Script
- From: "Jonathan Levi, M.D." <email@hidden>
- Date: Tue, 31 May 2005 09:11:36 -0400
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden