• 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: Launching TextEdit with a TEXT document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Launching TextEdit with a TEXT document


  • Subject: Re: Launching TextEdit with a TEXT document
  • From: Paul Berkowitz <email@hidden>
  • Date: Wed, 18 Feb 2004 12:16:30 -0800

On 2/18/04 11:31 AM, "Christopher Nebel" <email@hidden> wrote:

> On Feb 17, 2004, at 4:56 PM, Walter Ian Kaye wrote:
>
>>> For some reason, the Finder won't actually get the application file
>>> id of
>>> any app or app file any longer: if it isn't followed by a 4-character
>>> string
>>> code 'id' errors. Bah.
>>
>> Wha? Panther kill BIs?!
>
> Not as far as I can tell -- it works just fine for me. If someone can
> reproduce this reliably, let me know.

That was a misunderstanding on boo's part and an error on my part. Panther
gets bundle identifiers (info for) just fine. I was erroneously attempting
to

tell app "Finder" to get application file id of (application file of
process "TextEdit")

which is meaningless, instead of

tell app "Finder" to get creator type of (application file of process
"TextEdit")

or
file creator of (info for alias ((path to applications folder as Unicode
text) & "TextEdit.app"))

I was incorrectly expecting

tell app "Finder" to get application file id of [an app file]

to return the 4-character code. But it doesn't work that way of course. It
errors on 'id', as I reported, since 'application file' should be followed
here by the name or path of the file. You retrieve the 4-char code by asking
for creator type, or file creator of info for, and then _use_ it as

tell app "Finder" to get application file id "xxxx"

I'm not quite sure how boo misconstrued that quite the way he did, but I
confirm that

bundle identifier of (info for alias ((path to applications folder as
Unicode text) & "TextEdit.app"))
--> "com.apple.TextEdit"

and

tell application "Finder" to get application file id
"com.apple.TextEdit"
--> application file "TextEdit.app" of folder "Applications" of startup
disk of application "Finder"

tell application "Finder" to get application file id
"com.apple.TextEdit" as alias
-->alias "Backup HD Extra:Applications:TextEdit.app:"

tell application "Finder" to get application file id "ttxt" as alias
--> alias "Backup HD Extra:Applications:TextEdit.app:"

all work as they should. And pretty cool too.


--
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.

  • Follow-Ups:
    • Re: Launching TextEdit with a TEXT document
      • From: Walter Ian Kaye <email@hidden>
References: 
 >Re: Launching TextEdit with a TEXT document (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: Launching TextEdit with a TEXT document
  • Next by Date: Re: AppleScript Read file in Filemaker
  • Previous by thread: Re: Launching TextEdit with a TEXT document
  • Next by thread: Re: Launching TextEdit with a TEXT document
  • Index(es):
    • Date
    • Thread