• 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: Getting an app's identifier
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Getting an app's identifier
      • From: Rob Jorgensen <email@hidden>
  • Prev by Date: Getting an app's identifier
  • Next by Date: Re: Getting an app's identifier
  • Previous by thread: Getting an app's identifier
  • Next by thread: Re: Getting an app's identifier
  • Index(es):
    • Date
    • Thread