Re: dd: obtaining an iTunes CD playlist
Re: dd: obtaining an iTunes CD playlist
- Subject: Re: dd: obtaining an iTunes CD playlist
- From: Rob Jorgensen <email@hidden>
- Date: Wed, 6 Mar 2002 00:44:15 -0500
On 3/6/02, dave dowling commented:
i'm trying to get the playlist of an audio CD in iTunes. my problem
is that i can't get iTunes to count the number of songs in the CD's
playlist. it returns a count of 0, when there are 14 songs on the
CD.
here's what i have so far:
tell application "iTunes"
repeat with i from 1 to count sources
set x to kind of source i
if x as string = "audio CD" then
set y to name of source i
set n to (count audio CD tracks of source y)
end if
end repeat
end tell
I don't script iTunes (I rarely use it) but here's a 1-liner which
appears to count my playlist accurately. The result agrees with the
count displayed by iTunes in the playlist window. Maybe you can plug
this into the code above and make it work.
tell application "iTunes" to set trackCount to count tracks in playlist 1
If it would be helpful to look at some existing iTunes scripts, there
are several (editable) available at ScriptBuilders. Here's a URL
which will line them up for your inspection.
<
http://macscripter.net/sb_search.t?keyword=itunes&go=Search>
Later,
--
Rob Jorgensen
http://macscripter.net/ - Your best source for all things AppleScript
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.