remote itunes access

ok so this line compiles in script editor but not xcode.

			tell application "iTunes" of machine theComp
				next track
			end tell

theComp is set to the ip address of the computer. if i remove next track then it compiles, so its the next track part thats the problem.

Hi,

tell application "x" of something

doesn’t resolve the terminology of application “x”.
You must use either

tell application "iTunes" of machine theComp
    using terms from application "iTunes"
        next track
    end using terms from
end tell

or

tell machine theComp
    tell application "iTunes"
        next track
    end tell
end tell

cool, it worked. i have a few more questions about controlling itunes. my app is an itunes controller (remote and local) and when i get the track name using this code:

set theTrack to (get name of current track)

it says it cant make it into type reference.

and my second thing is that my interface is like an ipod, so i need help with the progress bar part, like i want it to show the amount of time remaining and the amount i have listened to and display it in a progress bar like on the ipod.

thanks.

Hi fiftyfour123

the below will return a selected track.

tell application "iTunes"
	set _selection to name of selection as string
end tell

this will return the current playing track.

tell application "iTunes"
	if player state is playing then
		set _selection to current track
	end if
	tell _selection to set _Title to (get name)
	--tell sel to set _Artist to (get artist)
end tell

oops sorry “if player state is playing then” should be “if player state is not playing then return”
or iTunes will say “variable _selection not defined” if iTunes isn’t playing.

tell application "iTunes"
if player state is not playing then return
	set _selection to current track
tell _selection to set _Title to (get name)
	--tell sel to set _Artist to (get artist)
end tell

that still gives me the same error

this and the previous posts scripts work fine here using “iTunes 7.3.1 (3)” :confused:

tell application "iTunes"
	using terms from application "iTunes"
		if player state is not playing then return
		set _selection to current track
		tell _selection to set _Title to (get name)
	end using terms from
end tell

ok, i’ll see, but what about my second question

and my second thing is that my interface is like an ipod, so i need help with the progress bar part, like i want it to show the amount of time remaining and the amount i have listened to and display it in a progress bar like on the ipod.

theirs an array of information to do with “progress bars”

Etra Suites:
http://www.kanzu.com/

Some code for Extra Suites:
http://bbs.applescript.net/viewtopic.php?id=4887

A quick search in the forum “Applescript Studio & Xcode” using “progress bar” as the Keyword for searching revealed this huge resource on progress bars

http://bbs.applescript.net/search.php?action=search&keywords=progress+bar&author=&forum=3&sort_by=5&sort_dir=DESC&show_as=topics&search=Submit

is there an alternative to extra suites thats free?

not that Im aware of.

well, i looked at all of your links and searched around and couldnt find anything that answers this:

found this

http://scriptbuilders.net/files/myprogressbar1.0.html

http://macscripter.net/articles/455_0_10_0_C/

could be of help:

http://bbs.applescript.net/viewtopic.php?id=11385