Re: Getting an app's identifier
Re: Getting an app's identifier
- Subject: Re: Getting an app's identifier
- From: Rob Jorgensen <email@hidden>
- Date: Thu, 29 May 2003 22:31:30 -0400
At 9:26 PM -0400 5/29/03, Steve Roy wrote:
Hi,
Is there a way with AppleScript to get the identifier used by an application?
For example, the identifier for Preview is com.apple.Preview. I'm
looking at the
Finder dictionary and can't see a propery that gives that. Any ideas anyone?
This seems to work well on apps that have an application file ID
(which seems to be a hit and miss proposition). I tested it on a few
such apps and it worked fine. Be aware of the continuation of line 2.
tell application "Finder"
set {containsApp, nameOfApp} to {container, name} ,
of (application file id "cfbs") -- "cfbs" = DVD Player |"MACS" = Finder
end tell
set pathToInfoPlist to (containsApp as text) & nameOfApp & ":Contents:info"
set quotedPlistPath to (quoted form of POSIX path of pathToInfoPlist)
set shellCommand to "defaults read " & quotedPlistPath & " CFBundleIdentifier"
set identifier_ to do shell script shellCommand
--
Rob Jorgensen
Ohio, USA
_______________________________________________
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.