You are not logged in.
there must be some change in the iTunes dictionary for iTunes 7.1.1 because my script that worked with 7.0 no longer works. It's this piece of code:
Applescript:
tell application "iTunes"
set view of browser window 1 to library playlist 1
end tell
EDIT: I meant ot put this in the AS Studio thread, sorry:P
Last edited by hendo13 (2007-03-25 12:43:51 pm)
Offline
I moved it to OS X.
Offline
I did try getting the name and setting it as a user playlist, but because the name comes back as "Library"
it did not work
it took a google to find it,
Applescript:
tell application "iTunes"
set view of browser window 1 to user playlist "Music"
end
Be nice if apple updated the .sdef to show changes.
Last edited by mark hunte (2007-03-25 01:07:35 pm)
Offline
mark hunte wrote:
Applescript:
tell application "iTunes"
set view of browser window 1 to user playlist "Music"
end
That won't work as expected for non-English users.
Offline
couldn't you just go
Applescript:
tell application "iTunes"
set view of browser window 1 to user playlist "Music" or "Musique"
end
Last edited by hendo13 (2007-03-25 01:28:03 pm)
Offline
Ok, some playing,
It would seem that the Music/Library is a smart playlist.
It does not get listed as user playlist 1, because it actually slips in to the list of smart playlist names in the M's in the English case.
Still trying to see if I can find a way to it without having to use its Smart Playlist name.
Offline
Hi,
Are you all saying that there is no library playlist property in the updated iTunes? In that case many iTunes scripts are now broken in the updated version. Almost all the scripts begin with getting the library playlist.
Applescript:
tell application "iTunes"
activate
set lib_pl to first library playlist
set view of first browser window to lib_pl
end tell
This wouldn't work?
gl,
Offline
nope, not anymore...![]()
the stupid thing is you can't create smart playlists programmatically either (except for GUI scripting)
Last edited by hendo13 (2007-03-25 03:37:27 pm)
Offline
'special kind' Man staring me in the face all that time.
I suspect that 'set view of browser window 1 to user playlist "Music"' would work in all Languages also.
I created two playlists called music one smart one not.
'set view of browser window 1 to user playlist "Music" only ever goes to the 'Special' Music playlist (library 1)
Offline
I meant to say library playlist object.
Then the library playlist class won't compile in versions greater than 7.0 and you would get raw data for older scripts.
Offline
mark hunte wrote:
I suspect that 'set view of browser window 1 to user playlist "Music"' would work in all Languages also.
I created two playlists called music one smart one not.
'set view of browser window 1 to user playlist "Music" only ever goes to the 'Special' Music playlist (library 1)
I tried that too, but in other languages that main playlist is not called "Music"; It's localized. (Pick a different language in System Preferences and see for yourself).
kel wrote:
Are you all saying that there is no library playlist property in the updated iTunes?
mark hunte wrote:
It would seem that the Music/Library is a smart playlist.
The library playlist class still exists; However, I believe the "main" playlist a user uses has changed (like Mark mentioned). Consider this:
Applescript:
tell application "iTunes"
count (tracks of library playlist 1)
end tell
My "Music" playlist has 840 songs, but the above script returns 880 (the other 40 items are videos and podcasts).
Offline
Jacques wrote:
Applescript:
tell application "iTunes"
if (get version) as string < "7.1" then
set Master_Playlist to library playlist 1
else
set Master_Playlist to first playlist whose special kind is Music
end if
set view of browser window 1 to Master_Playlist
end tell
since in this snippet Music is not a string but an attribute it will work for all languages right?
Offline
Bruce Phillips wrote:
I tried that too, but in other languages that main playlist is not called "Music"; It's localized. (Pick a different language in System Preferences and see for yourself).
Thanks Bruce just did that, yep it does not work.
So the only way to make it Localised is to use the Special Kind.
Offline
First of all, library playlist 1 can no longer be the object of a window's view http://dougscripts.com/itunes/itinfo/itunes71info.php. This was done intentionally. Second, to display the Music playlist (which, yes, is a hard-coded Smart Playlist; see http://dougscripts.com/itunes/itinfo/it … erlibs.php) do this:
Applescript:
tell application "iTunes"
set view of front browser window to (get some playlist whose special kind is Music)
end tell
The Music playlist, however, is not the entire library, like "Library" playlist used to be. "Music" only displays audio tracks and PDFs. A workaround is to create a Smart Playlist with the criteria "size" - "is greater than" - "0"; name it "Everything". To display it, use this:
Applescript:
tell application "iTunes"
set view of front browser window to playlist "Everything"
end tell
Offline