Remote Apple Events Problems

Something very strange is going on with my program. I’m trying to control and get data from iTunes on a remote computer using remote apple events.

Here are some snippets that work and don’t work.

This works in Applescript Editor and in an Applescript Studio app but doesn’t in my ApplescriptObjC app in xcode:

set theIP to "192.168.1.1.xxx"
tell application "iTunes" of machine ("eppc://" & theIP)
     using terms from application "iTunes'
          playpause
     end using terms from
end tell

The above script also doesn’t work in my ApplescriptObjC app when I include the username and password.

This works in every case but for obvious reasons (the IP address changes from user to user) I cannot use this in my final ApplescriptObjC app:

tell application "iTunes" of machine "eppc://username:password@192.168.1.xxx"
     using terms from application "iTunes'
          playpause
     end using terms from
end tell

I get the IP address using

choose URL

and then I remove the afp:// and port number using text item delimiters.

I basically need the ApplescriptObjC app to talk to iTunes on a remote machine at a dynamic IP address.

Thanks for any help!

EDIT: Sorry, I should note that when I say it doesn’t work, I mean I get an error saying “Can’t find remote machine.”

What happens if you use:

choose URL showing Remote applications

instead?

wow, that’s much better than choose URL, but I still get this:

Can't find remote machine. (error -915)

anyone?

can anyone reproduce this error, or is it just me?

You can’t look back? Remote machine is broken in Snow Leopard so far.

It works fine for me. Just not when the remote machine’s IP is in a variable.

anyone?

No one. :frowning:

its so annoying. this one problem is keeping me from finishing this program. haha

anyone?

Hey! Exact same script and exact same error! :stuck_out_tongue: My script works fine in Applescript Editor but breaks in Xcode. Any ideas?


set remMachine to "eppc://xxxxx:xxxxx@10.0.2.4"
		using terms from application "iTunes"
			try
				tell application "iTunes" of machine remMachine
					playpause
				end tell
			on error errM number errN
				display dialog (errM & space & errN)
			end try
		end using terms from