Sunday, November 29, 2020

#1 2017-07-31 09:32:11 am

daBee
Member
From:: Toronto
Registered: 2010-02-09
Posts: 139

iTunes Select Playlist

Hi folks.  I want to navigate iTunes.  I want to have the itunes window just choose a playlist names "alpha".  That's it. 

I don't want a reference to it.  I don't want it to play.  I don't want to purchase anything.  I just want to have iTunes to activate with a playlist chosen.  That's it. 

Tried select, reveal, get properties.  I can't seem to get anything going, and all of the script examples I've found online want to update podcasts, play next tune, etc.  I don't want to play anything. 

Any advice appreciated. 

Cheers


Filed under: iTunes, select, playlist

Offline

 

#2 2017-07-31 12:58:49 pm

haolesurferdude
Member
Registered: 2010-02-19
Posts: 137

Re: iTunes Select Playlist

Change "alpha" to any playlist you have created in the library.

Applescript:


tell application "iTunes"
   set view of front browser window to user playlist "alpha" of source "Library"
end tell

Offline

 

#3 2020-11-19 12:52:18 am

KniazidisR
Member
From:: Greece
Registered: 2019-03-03
Posts: 1444

Re: iTunes Select Playlist

Well, the solution is correct, thanks . But, to bring the selected playlist to front is need 2 additional instructions:

Applescript:


tell application "Music" -- or, "iTunes" on old sysytems
   activate
   set view of front browser window to user playlist "alpha" of source "Library"
   set visible of front browser window to true
end tell

Choose playlist name version:

Applescript:


tell application "Music"
   activate
   set sourcesNames to name of every source
   set theChoice to choose from list sourcesNames with prompt "PLEASE SELECT THE SOURCE"
   if theChoice is not false then
       set theSourceName to item 1 of theChoice
       set playlistNames to name of every playlist of source theSourceName
       set theChoice to choose from list playlistNames with prompt "PLEASE SELECT THE PLAYLIST"
       if theChoice is not false then
           set selectedPlayList to playlist (item 1 of theChoice) of source theSourceName
           set view of front browser window to selectedPlayList
           set visible of front browser window to true
       end if
   end if
end tell

Last edited by KniazidisR (2020-11-19 12:59:07 am)


Model: MacBook Pro
OS X: Catalina 10.15.4
Web Browser: Safari 13.1
Ram: 4 GB

Offline

 

#4 2020-11-22 10:30:31 pm

technomorph
Member
Registered: 2017-12-14
Posts: 173

Re: iTunes Select Playlist

Try the REVEAL

Applescript:

tell application "iTunes"
       try
           --activate
           set frontmost to true
delay 0.2
           --(current application's NSThread)'s sleepForTimeInterval:0.2
           set thePlaylist to user playlist "alpha" of source id 64
           delay 0.2
--(current application's NSThread)'s sleepForTimeInterval:0.2
           reveal thePlaylist    
       end try
end tell

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)