If you turn on Remote Apple Events and have a user account on the target computer with permission to send Apple Events, you can control iTunes across the Internet!
Substitute the IP address of the remote app in the following example:
Code:
-- launch iTunes
using terms from application "Finder"
tell application "finder" of machine "eppc://10.0.1.2"
set the target_app to application file id "com.apple.itunes"
open the target_app
end tell
end using terms from
delay 4 -- wait for it to start
-- control the app
using terms from application "iTunes"
tell application "Itunes" of machine "eppc://10.0.1.2"
play first track of playlist "Top 25 Most Played"
end tell
end using terms from
You can even find out what song the app is playing!
Code:
using terms from application "iTunes"
tell application "Itunes" of machine "eppc://10.0.1.2"
get the name of the current track
end tell
end using terms from