• 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: How to reliably get an application's creator type on MacOS X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to reliably get an application's creator type on MacOS X


  • Subject: Re: How to reliably get an application's creator type on MacOS X
  • From: Chris Nebel <email@hidden>
  • Date: Sat, 14 Apr 2001 19:50:28 -0700
  • Organization: Apple Computer, Inc.

Mark Alldritt wrote:

> As far as I can tell, the "info for" command in StandardAdditions and the
> Finder's creator type property cannot be used to determine the creator type
> (i.e. Signature) of a bundled application on MacOS X (e.g. Mail.app).
>
> Here's some code that uses my XML Tools scripting addition to reliably get
> the creator type of an application: ...

Mark is correct that "info for" as of AppleScript 1.6 doesn't know about
packages, and just treats them as folders. (We have a bug against this.) In
the meantime, though, there's an easier way to get the creator code than Mark's
XML solution. All packaged applications are supposed to contain a "PkgInfo"
file inside the "Contents" folder -- it's eight bytes long, and contains the
type and creator mashed together (e.g. "APPLToyS"). Therefore, to get the
creator, you can do something like this:

to getCreatorCode(app)
try
return file creator of (info for theAppFile)
on error
return (read file (app as string & "Contents:PkgInfo") from 5)
end
end


--Chris Nebel
AppleScript Engineering


References: 
 >How to reliably get an application's creator type on MacOS X (From: Mark Alldritt <email@hidden>)

  • Prev by Date: Re: Applescript CGI Counter
  • Next by Date: Re: Coerce String to Handler?
  • Previous by thread: Re: How to reliably get an application's creator type on MacOS X
  • Next by thread: Select every generic box in Quark not consistent
  • Index(es):
    • Date
    • Thread