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 ""
tell application "iTunes" of machine ("eppc://" & theIP)
     using terms from application "iTunes'
     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://"
     using terms from application "iTunes'
     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


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

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


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.


No one. :frowning:

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


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@"
		using terms from application "iTunes"
				tell application "iTunes" of machine remMachine
				end tell
			on error errM number errN
				display dialog (errM & space & errN)
			end try
		end using terms from