Emulating "Send to Program" |
|
In which « and » are to be replacd by their single-char equivalents for MacOS (ASCII- 199 and 200).tell application "Foo" of machine "Bar" «event rIPCrIPL» "Hello there!" & return end tell
So here's a sample code that works:
Note: this was very messy to debug, and I crashed my iBook several times before I got it right.on SelectProgramAndSendAE pAEclass, pAEid, pAEdata do "choose application" as AppleScript put the result into tResult if tResult is "execution error" then return "Cancel" else put tResult into tProgram -- looks like: application "Foo" of machine "Bar" put "tell" && tProgram & return into tAScript put numToChar(199) & "event" && pAEclass & pAEid \ & numToChar(200) && pAEdata && "& return" & \ return after tAScript put "end tell" & return after tAScript do tAScript as AppleScript return the result end SelectProgramAndSendAE
Warning: if the application on the other side is a RunRev-built one, make sure you 'pass' any AppleEvent message that you don't handle with a 'reply', or you risk freezing up the client-side computer.
Posted on 3/16/2003 by Jan Schenkel to the Use-Revolution List (See the complete post/thread)