iTunes Question.

How do i play a shared track?

My folder library is named “This is a test” example and it is a shared library on another computer.

I would like to play the first track of this library or a name of a track.

play track 1 of …shared track …

Greetings

Mr Designer

Model: G5 Dual 2.7
AppleScript: new
Browser: Firefox 1.0.6
Operating System: Mac OS X (10.4)

Mr Designer:

I have been messing with this whole shared track thing all day, off and on and have been frustrated at every turn. This is all I could figure out how to do:

Open up your iTunes, and and select the shared playlist you want, then run this script:

tell application "iTunes"
	set thePlaylist to view of front window
end tell
thePlaylist

The results pane will show something like this:

library playlist id 4042 of source id 4041 of application “iTunes”

use the two numbers to replace xxx and yyy in this next script:

tell application "iTunes"
	set b to every track of library playlist id xxx of source id yyy
end tell
set a to text returned of (display dialog "Pick a track from 1 to " & (count b) & ":" default answer "") as integer
tell application "iTunes"
	play item a of b
end tell

This allows you to pick a number and play the track. b is a list of all the tracks by id number in the selected shared playlist. As long as that playlist never moves, the script should work any time you run it. You can also see the names, albums, or whatever of the tracks in a list, or list of lists, using a variant of this script:

tell application "iTunes"
	set b to every track of library playlist id xxx of source id yyy
	set c to {}
	repeat with a from 1 to count b
		set end of c to name of (item a of b)
	end repeat
end tell

Now, c is a list of the names of all the tracks, and should be in proper order (respective to b) of where they are. You can choose from that list, or search on that list, and then access the same item number in list b to play the track.

I hope this helps a little bit, or that someone else figures out a cleaner way to do it.

casdvm