I am trying to tell itunes to play over a network. The first script works fine. But, I wanted the computer name to be variable. The second script does not work. Any ideas why?
works
tell application "iTunes" of machine "eppc://central"
play playlist "library"
end tell
does not work
set name1 to "central" as string
tell application "iTunes" of machine (("eppc://") & name1)
play playlist "library"
end tell
it is suppost to be central, which is the name of the computer I want to talk to. I tried to set it as a string, but no luck. i think it is because there are “” in the first one, but not around the variable in the second? Weird thing is that this will tell it to quit. But the above script errors “expect end of line but found identifier”
set name1 to "central" as string
tell application "iTunes" of machine (("eppc://") & name1)
quit
end tell
hmmm… I can’t test this - becasue I don’t have access to anyone else’s lib right now… but try this
I had to comment out “play playlist “library”” becasue it won’t compile without a valid connection
set name1 to "central" as string
set serverAddress to "eppc://" & name1
tell application "iTunes" of machine serverAddress
--or this might work
-- tell application "iTunes" of machine (quoted form of serverAddress)
--play playlist "library"
end tell
That doesn’t work either. I do not understand why the first two would work, and the second will not. cenrtal is the name of a computer on my network. it is weird.
works:
set name1 to "central" as string
tell application "iTunes" of machine "eppc://central"
play playlist "library"
end tell
works:
set name1 to "central" as string
tell application "iTunes" of machine (("eppc://") & name1)
quit
end tell
does not work:
set name1 to "central" as string
tell application "iTunes" of machine (("eppc://") & name1)
play playlist "library"
end tell
I believe that the proper syntax is :
tell application "iTunes of machine “eppc://userid:password@192.168.1.10”
fill in your own user id and password and machine ip
HTH