Re: How to open Package folder?
Re: How to open Package folder?
- Subject: Re: How to open Package folder?
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 03 Sep 2003 17:27:33 -0700
On 9/3/03 4:00 PM, "Sung Kim" <email@hidden> wrote:
>
Instead of launching an application, how can we ask the Finder to open the
>
package folder (via AppleScript, that is)? Thank you.
>
This will give you the idea:
set thePackagePath to alias "OS X HD:Applications:Chess.app:" as Unicode
text
tell application "Finder"
activate
set theContents to folder (thePackagePath & "Contents:MacOS:")
reveal theContents
end tell
Note that you must do the first line as 'alias', not as a Finder 'item'
which strips off the final colon. If hardcoding the package in, as above,
always include ".app:" at the end. If using a droplet in will do it by
itself:
on open (theFiles)
repeat with i from 1 to count theFiles
set theFile to item i of theFiles -- an alias
set isPackage to package folder of (info for theFile) -- boolean
tell application "Finder"
activate
if isPackage then
set thePackagePath to theFile as Unicode text
set theContents to folder (thePackagePath &
"Contents:MacOS:")
reveal theContents
else
reveal theFile
end if
end tell
end repeat
end open
(It works with regular folders, too.)
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.