Re: application file id?
Re: application file id?
- Subject: Re: application file id?
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 05 May 2003 10:42:40 -0700
On 5/5/03 9:39 AM, "Jeff Ganyard" <email@hidden> wrote:
>
>
That's good to know! I must have overlooked it in release notes. I
>
noticed that 'info for' does not return the bundle identifier. is there
>
some way to discover the identifier via script?
Yes, but it's longwinded. if
if package folder of (info for aFile)
is true, then you know there's an Info.plist inside the package contents.
Here's an example:
set aFile to alias ((path to "apps" from local domain as Unicode text) &
"Chess.app")
set fileInfo to (info for aFile)
if package folder of fileInfo then
set plistFile to alias ((aFile as Unicode text) &
":Contents:Info.plist")
set r to read plistFile
set AppleScript's text item delimiters to
{"<key>CFBundleIdentifier</key>"}
set r to text item 2 of r
set AppleScript's text item delimiters to {"<string>"}
set r to text item 2 of r
set AppleScript's text item delimiters to {"</string>"}
set iden to text item 1 of r
--> "com.Apple.Chess"
set AppleScript's text item delimiters to {""}
else
set iden to file creator of fileInfo
end if
tell application "Finder"
set appFile to application file id iden --as Unicode text
end tell
--
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.