Re: Application creator code
Re: Application creator code
- Subject: Re: Application creator code
- From: "Gary (Lists)" <email@hidden>
- Date: Tue, 26 Apr 2005 06:23:20 -0400
Noodle wrote [4/26/05 5:35 AM]:
> Hi All,
>
> I'm having problems selecting an application using it's creator code.
> I've successfully used the following code for a different application:
>
> tell application "Finder"
> open application file id "XXXX"
> end tell
>
> but for the one I want to talk to now it doesn't work.
>
> I found in the archives the following code:
>
> set TheApp to choose file of type "APPL"
> set the clipboard to (info for TheApp)'s file creator
>
>
> When I run the above script I get a null (no characters) creator code
> from the application in question (works fine for other apps).
I'm not sure what you are doing with the clipboard, or why exactly.
But, let's go back to June, 2003 where we have to refer to December, 2002:
> Check the archive for this list, at date Dec-10/11-02 for the thread : "Stuck
> trying to use creatorid to control IE".
>
> I offered the chunk with <<class PSN >> and Emmanuel alerted us all to the
> fact that we didn't that class fragment at all! Even better.
>
> So, go check out the AS-Users List archive, extending to Dec-11-02 where Paul
> B. and Emmanuel "set us all straight". [As they so often -- and thankfully --
> do.]
Saving you a real trip to the web archive, here are a couple of lessons
learned and options that work OMM (OS9.1), targeting BBEdit 6, for example.
Perhaps (?) the best choice of the two is the first --
Method 1
tell application "Finder" to set bb to [NO-LINE-BREAK]
(name of first process whose creator type is ("R*ch" as type class))
tell bb
activate
-- do stuff...
end tell
Method 2
tell application "Finder" -- split for clarity
open application file id "R*ch"
set AppName to name of result --"BBEdit"
end tell
tell application AppName
activate
-- do stuff...
end tell
This method may be less useful, depending on the application. I hear it can
often prevent you from utilizing every entry in the app's dictionary. I know
not why. (See that thread above for some comments from others on that.)
Oh, don't mention <<class psn >> or Emmanuel and Paul will have to search
their archive and make hay with the notion.
--
Gary
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden