Apple Events?
Mark Schonewille
m.schonewille at economy-x-talk.com
Sun Jun 4 18:04:13 EDT 2006
Hi Todd,
I wrote this while you were experimenting with apple events.
It always seemed illogical to me to put an appleEvent handler into
the card script, because normally you want the handler to run
regardless of which card is the current card. If the event cannot be
handled for whatever reason, you would still want to give feedback to
tell the user that whatever he did is not allowed.
You can send AppleEvents from AppleScript, but there are also many
user actions that cause an AppleEvent. The most important one
probably being the even that is sent if a file is double-clicked in
the Finder. To test this, tell the Finder to open a file with your
standalone (change this in the Info window). Double-click the file
and see what happens.
It should be possible to run an AppleScript script like this:
tell application "Revolution"
«event abcd1234» "Event Data"
end tell
abcd is the class, 1234 the ID, and you get the string "Event Data"
using the Transcript syntax
request appleEvent data
Now, this doesn't work, for reasons explained by Ken. There is an
aete resource in Revolution, but it seems incomplete, as it doesn't
even contain a required suite. I checked ftp.metacard.com, but there
is no OSX version of MetaCard available there, anymore. If anyone
could send me the aete resource from the MetaCard engine for OSX,
which is needed to get apple events working, I would be very grateful.
There is also some good news: the above AppleScript works fine in Mac
OS 9, with the Classic version of Revolution 2.6.1.
I think that the incomplete aete resource is quite essential for Mac
OS users. If it is not in Bugzilla yet, I believe it should be reported.
Best,
Mark
--
Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz
Salery is the easiest way to get your own web store on-line: http://
www.salery.biz/salery.html
Op 4-jun-2006, om 22:14 heeft Todd Geist het volgende geschreven:
>
> Thanks Mark!
>
> But then what do I do?
>
> Lets suppose I want to send Apple Events from Rev for the moment. Can
> I target this lettle Rev App with an Applescript? Will it then report
> the Apple event syntax that I need to usse?
>
> Also I noticed that the docs say to place the appleEvent Message
> handler in the "current card script, not the stack script. Does it
> matter? Or will the message just go throught the current card first
> then on to the stack?
>
>
> Thanks Again?
>
> Todd
More information about the use-livecode
mailing list