Friday, July 30, 2010

#1 2007-03-25 12:07:36 pm

hendo13
Member
From: Barrie, Ontario
Registered: 2006-06-04
Posts: 542
Website

iTunes 7.1 screwing up my script…

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)


That was a message from Hendo!

Filed under: iTunes

Offline

 

#2 2007-03-25 12:46:12 pm

Bruce Phillips
Administrator
Registered: 2004-07-15
Posts: 2647

Re: iTunes 7.1 screwing up my script…

I moved it to OS X.

Offline

 

#3 2007-03-25 12:47:05 pm

hendo13
Member
From: Barrie, Ontario
Registered: 2006-06-04
Posts: 542
Website

Re: iTunes 7.1 screwing up my script…

oh..lol...well do oyu know what the problem is?


That was a message from Hendo!

Offline

 

#4 2007-03-25 01:05:23 pm

mark hunte
Member
From: Hello, London Calling
Registered: 2006-03-20
Posts: 907

Re: iTunes 7.1 screwing up my script…

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)


Tap,tap,tap , hello , testing 1..2,  1...2,

Filed under: iTunes

Offline

 

#5 2007-03-25 01:09:28 pm

Bruce Phillips
Administrator
Registered: 2004-07-15
Posts: 2647

Re: iTunes 7.1 screwing up my script…

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.


Filed under: iTunes

Offline

 

#6 2007-03-25 01:26:52 pm

hendo13
Member
From: Barrie, Ontario
Registered: 2006-06-04
Posts: 542
Website

Re: iTunes 7.1 screwing up my script…

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)


That was a message from Hendo!

Filed under: iTunes

Offline

 

#7 2007-03-25 01:35:12 pm

hendo13
Member
From: Barrie, Ontario
Registered: 2006-06-04
Posts: 542
Website

Re: iTunes 7.1 screwing up my script…

oh wait, i guess there is more than french and english...


That was a message from Hendo!

Offline

 

#8 2007-03-25 01:43:38 pm

hendo13
Member
From: Barrie, Ontario
Registered: 2006-06-04
Posts: 542
Website

Re: iTunes 7.1 screwing up my script…

sorry for like the triple post here...but this works

Applescript:

set view of browser window 1 to user playlist 1


That was a message from Hendo!

Offline

 

#9 2007-03-25 02:00:50 pm

hendo13
Member
From: Barrie, Ontario
Registered: 2006-06-04
Posts: 542
Website

Re: iTunes 7.1 screwing up my script…

wooo, quadruple post!

ok, that doesn't work, that sets it to the party shuffle playlist...thats so weird that library playlist 1 won't work...


That was a message from Hendo!

Offline

 

#10 2007-03-25 03:07:38 pm

mark hunte
Member
From: Hello, London Calling
Registered: 2006-03-20
Posts: 907

Re: iTunes 7.1 screwing up my script…

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.


Tap,tap,tap , hello , testing 1..2,  1...2,

Offline

 

#11 2007-03-25 03:27:33 pm

kel
Member
Registered: 2002-11-19
Posts: 2031

Re: iTunes 7.1 screwing up my script…

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,


Kel

Filed under: iTunes

Offline

 

#12 2007-03-25 03:36:45 pm

hendo13
Member
From: Barrie, Ontario
Registered: 2006-06-04
Posts: 542
Website

Re: iTunes 7.1 screwing up my script…

nope, not anymore...sad

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)


That was a message from Hendo!

Offline

 

#13 2007-03-25 04:36:57 pm

hendo13
Member
From: Barrie, Ontario
Registered: 2006-06-04
Posts: 542
Website

Re: iTunes 7.1 screwing up my script…

won't that only work for people who have english iTunes?


That was a message from Hendo!

Offline

 

#14 2007-03-25 04:49:48 pm

mark hunte
Member
From: Hello, London Calling
Registered: 2006-03-20
Posts: 907

Re: iTunes 7.1 screwing up my script…

'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)


Tap,tap,tap , hello , testing 1..2,  1...2,

Offline

 

#15 2007-03-25 05:01:06 pm

kel
Member
Registered: 2002-11-19
Posts: 2031

Re: iTunes 7.1 screwing up my script…

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.


Kel

Offline

 

#16 2007-03-25 05:22:23 pm

Bruce Phillips
Administrator
Registered: 2004-07-15
Posts: 2647

Re: iTunes 7.1 screwing up my script…

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).


Filed under: iTunes

Offline

 

#17 2007-03-25 05:51:13 pm

hendo13
Member
From: Barrie, Ontario
Registered: 2006-06-04
Posts: 542
Website

Re: iTunes 7.1 screwing up my script…

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?


That was a message from Hendo!

Filed under: iTunes

Offline

 

#18 2007-03-25 06:02:48 pm

mark hunte
Member
From: Hello, London Calling
Registered: 2006-03-20
Posts: 907

Re: iTunes 7.1 screwing up my script…

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.


Tap,tap,tap , hello , testing 1..2,  1...2,

Offline

 

#19 2007-03-25 06:27:25 pm

DougAdams
Member
From: Newton, MA, USA
Registered: 2003-05-09
Posts: 65
Website

Re: iTunes 7.1 screwing up my script…

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

See http://dougscripts.com/itunes/ixarch/ar … -03#030707


Doug

Filed under: iTunes

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.318 seconds, 10 queries executed ]

RSS (new topics) RSS (active topics)