How to I receive AppleScript?

J. Landman Gay jacque at hyperactivesw.com
Sun Jan 4 01:12:21 EST 2015


On 1/3/2015 8:42 PM, Bill Vlahos wrote:
> I can send an AppleScript to another program with LiveCode but I
> don’t see any examples of how to receive them.

There's an example in the docs under the "appleEvent" entry:

on appleEvent theClass,theID
   if theClass is "misc" and theID is "dosc" then
     request appleEvent data -- get the content of the AppleEvent
     do URL ("file:" & it)
   end if
   pass appleEvent
end appleEvent

Put it in the stack script, or somewhere else that is always in the 
message path. You need to know the class and ID that you want to catch. 
If you don't already, you could get it this way:

on appleEvent theClass,theID
   answer theClass && theID
end appleEvent

Then have the other app send an appleEvent to your stack and see what it 
answers. Once you know the class and ID, you can adjust the handler to 
work with the ones you want to catch.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com





More information about the use-livecode mailing list