Re: Accessing a file in a bundle
Re: Accessing a file in a bundle
- Subject: Re: Accessing a file in a bundle
- From: Mike Kobb <email@hidden>
- Date: Thu, 10 Jan 2008 14:52:27 -0800
Sure enough, it was as easy as:
tell application "System Events"
set prefBundle to file package "path:to:my:file.prefPane"
open file "MyHelperApp" of folder "Resources" of folder "Contents" of
prefBundle
end tell
That first "set" line can just say "file" instead of "file package",
but the type returned is a file package. This was the missing piece
for me, as I was looking for "bundle" in the documentation, which I
could not find.
Thanks!
--Mike
On Jan 10, 2008, at 1:28 PM, Luther Fuller wrote:
Here's how I open a file located in a bundle ...
else if the result is "Help" then
tell application "Finder"
open file "Contents:Resources:Annotate Preferences Doc.pdf" of
(path to me)
end tell
return
end if
It works, so it must be the right direction.
On Jan 10, 2008, at 2:48 PM, Mike Kobb wrote:
As part of the same script I asked about earlier today, I need to
open (launch) a file that is inside a bundle. (Specifically, it's
a helper app that lives inside a System Preferences prefs pane
bundle.).
I googled around to try to find information on doing this, and I
found a script posted on the MacScripter BBS that seems to do just
what I want, using this terminology:
path to resource "myFile" in bundle file "<path to the bundle file>"
However, if I try to run this on Leopard, it's not recognizing the
"bundle file" terminology.
Could somebody please point me in the right direction? I need the
script to work on 10.4 and 10.5, but nothing earlier.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden