Re: opening a .app bundle
Re: opening a .app bundle
- Subject: Re: opening a .app bundle
- From: Christopher Nebel <email@hidden>
- Date: Thu, 11 Apr 2002 16:46:56 -0700
On Thursday, April 11, 2002, at 04:37 AM, Frank Blome wrote:
is there a way, to open an application bundle (like MyApplication.app)
with AppleScript?
That depends a bit on what you mean by "open". If you mean you want to
open a Finder window on the package (a la "Show Package Contents"), then
no, though if you're willing to limit yourself to application packages,
you can get pretty close. For example:
tell application "Finder"
tell folder "Applications" of the startup disk
open folder "Address Book.app"
-- fails; can't get folder "Address Book.app" of ...
open application file "Address Book.app"
-- launches the app; not what we want.
So far, we're out of luck -- the Finder insists that "Address Book.app"
is an application file, not a folder, and won't let us use it as one.
However, it still has folder-like elements, so if we rely on application
packages always having a "Contents" folder...
open folder "Contents" of application file "Address Book.app"
-- aha!
end tell
end tell
If you just want to grub around inside the package, use file objects and
commands as you normally would -- AppleScript doesn't really care about
the package-ness of a folder. For example...
list folder file ((path to startup disk as string) &
"Applications:Address Book.app:")
--> {"Contents"}
--Chris Nebel
AppleScript Engineering
_______________________________________________
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.