• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Play a random playlist in iTunes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Play a random playlist in iTunes


  • Subject: Play a random playlist in iTunes
  • From: Michael Curtis <email@hidden>
  • Date: Sun, 23 Nov 2008 20:12:48 +0000

Hi,

I have found one of Doug's iTunes scripts and I want to adjust it. The original script had this line to get all the playlists. I don't want to return every playlist, I just want to add the ones I want. 

set the_playlists to the name of every playlist

I changed it to this line, but no joy. Where am I going wrong?

set the_playlists to the name of playlist {"_Recently Added", "Chill"}

The original script allows you to pick a random playlist or from a list of every playlist, a random song, or from the beginning of the playlist.

Any help would be most welcome. I have added the whole section at the bottom of this email.

Best wishes

Michael






tell application "iTunes"
set the_playlists to the name of every playlist
set count_pl to count the_playlists
if pick_random_pl then
set the_choice to item (random number from 1 to count_pl) of the_playlists
else
tell me
set the_choice to choose from list the_playlists with prompt "Pick a Playlist:"
end tell
end if
set the_pl to item 1 of (every playlist whose name is the_choice)
set the_total to count tracks in the_pl
if pick_random_song then
set n to random number from 1 to the_total
else
set n to 1
end if
play track n of the_pl
end tell

*****************************************************

This E-Mail has been scanned by Sophos Anti-Virus

*****************************************************

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Play a random playlist in iTunes
      • From: "J. Stewart" <email@hidden>
  • Prev by Date: Extract URL from Mail.app Message and download .tar file
  • Next by Date: Finder Copy to 'Cleanup At Startup' Folder in Leopard
  • Previous by thread: Extract URL from Mail.app Message and download .tar file
  • Next by thread: Re: Play a random playlist in iTunes
  • Index(es):
    • Date
    • Thread