Need Help!! Need to call handler in a script on another mac

I’m trying to write a script that calls a handler in another script (saved as an app and “stay open” checked) that resids on another computer from a script.

I have the code working it it is all on one computer.
Here is the code:

APP1
display dialog “Ready!!”
on hello(v)
set asdf to v + 33
display dialog asdf as string
return true
end hello

APP2
set mynum to 100
using terms from application “APP1”
tell application “APP1” of machine “eppc://192.168.1.16” to hello(mynum)
end using terms from

This gives me the error “can’t get the applications event dictionary”.

How do I get around this and/or is it even possible to call scripts on other machines from a script !?!

Any help is greatly apreciated !!!

THEJ

This may be a dumb question…but did you remember to turn on “remote apple events” on the remote computer? Also, since you have it returning a result I wonder if you need “remote apple events” turned on on the machine making the original request?

I’ve done a display dialog on a remote machine before with similar code. telling the Finder to display dialog. It worked, I didn’t have another scipt though. I’m assuming your actual script is more complex? Otherwise you wouldn’t need a second script to do this…just the script “APP2”, but it would need to have all the info from the first script in it.

set mynum to 100 
using terms from application "Finder" 
tell application "Finder" of machine "eppc://192.168.1.16"
display dialog mynum+33 as string
end using terms from

Also…I think you might need “authenticate” by adding a username and password so that the remote machine knows you are allowed to do things on it?

tell application "Finder" of machine "eppc://username:password@192.168.1.16" 

Just my thoughts, hope it helps…
D

Thanks Shai1 but my question wasn’t about getting remote events working (see my previous posting “Remote Scripting Solved !!!”) but rather calling a specific handler in a script on a remote system from a script on my local system.

I have been doing more reading to solve this and I think that what I’m trying to do will require Script Objects.

If anyone can answer this definitively for me please do !!!

Thanx

THEJ

Sounds like you’re not connecting with the remote app (typical unhelpful error message - blech). I dunno; check passwords, permissions, make sure you’re connecting to the machine itself, sacrifice a voodoo chicken, etc. If/when you do get it going, a remote script applet will work just like any other kind of remote app (i.e. doesn’t require messing with script objects or anything like that).