Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > AppleEvents

AppleEvents
Thread Tools
Mac Enthusiast
Join Date: Sep 2000
Location: Somewhere
Status: Offline
Reply With Quote
Jul 25, 2003, 03:54 PM
 
I've recently started working with AppleEvents. I keep running into things that I don't know how to do, though. I can send and receive events just fine, the question is just what events to send to do certain things.

Surely there must be a master list of these somewhere? At least for the Finder and some common things in applications?

Like, for example, I want to launch an application. I know I can tell the Finder to do this by sending it an event class "aevt" eventID "odoc" with the path in the parameter "----", but that seems like a bad way to do it. What if the user changes the name of the application? It seems I should be able to launch it by creator code, but I can't seem to find a reference to tell me this information.

Any suggestions?
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jul 27, 2003, 09:35 AM
 
For launching applications, just use LaunchServices. Also note that you should probably use bundle identifiers rather than creator codes.
     
Sal
Dedicated MacNNer
Join Date: Sep 2000
Location: Cupertino, CA USA
Status: Offline
Reply With Quote
Jul 28, 2003, 11:30 AM
 
Originally posted by ibookuser2:
I've recently started working with AppleEvents. I keep running into things that I don't know how to do, though. I can send and receive events just fine, the question is just what events to send to do certain things.

Surely there must be a master list of these somewhere? At least for the Finder and some common things in applications?

Like, for example, I want to launch an application. I know I can tell the Finder to do this by sending it an event class "aevt" eventID "odoc" with the path in the parameter "----", but that seems like a bad way to do it. What if the user changes the name of the application? It seems I should be able to launch it by creator code, but I can't seem to find a reference to tell me this information.

Any suggestions?
You can use the bundle identifier or the creator code when addressing an app via the Finder:

Code:
tell application "Finder" -- using bundle indentifier open (application file id "com.apple.preview") -- opening a file with an app open this_file using application file id "com.apple.preview" -- using creator code open (application file id "8BIM") -- opening a file with an app open this_file using application file id "8BIM" end tell
May I also suggest a visit to Apple's forum for AppleScript developers?

http://www.lists.apple.com/mailman/l...t-implementors
     
Senior User
Join Date: Oct 2000
Location: Midwest
Status: Offline
Reply With Quote
Jul 31, 2003, 11:31 PM
 
There is an app Smile that is a free alternative to the Applescript Script Editor. It is an very powerful tool. You can view different commands and objects that are available in applescript by their raw event id and event class.

HTH
Craig
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:14 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2