• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Accessing a file in a bundle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Accessing a file in a bundle
      • From: KOENIG Yvan <email@hidden>
References: 
 >Accessing a file in a bundle (From: Mike Kobb <email@hidden>)
 >Re: Accessing a file in a bundle (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Excel... again. Why doesn't this work
  • Next by Date: Re: "a reference to"
  • Previous by thread: Re: Accessing a file in a bundle
  • Next by thread: Re: Accessing a file in a bundle
  • Index(es):
    • Date
    • Thread