• 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
Re: Play a random playlist in iTunes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Play a random playlist in iTunes


  • Subject: Re: Play a random playlist in iTunes
  • From: "J. Stewart" <email@hidden>
  • Date: Mon, 24 Nov 2008 07:30:44 -0500

On 11/23/08 at 3:12 PM, Michael Curtis <email@hidden> spake thusly:

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

This isn't going to work because:
1) "name of playlist" is a string not a list, name of every playlist returns a list of strings, You're trying to set "the_playlists" to the name of a single playlist whose name is a list of strings.


2) You've already got the names you need in the statement and don't need to get them again.

This works fine OMM, just change the playlist names as required.

--> cut <--
set {pick_random_pl, pick_random_song} to {true, true}

tell application "iTunes"
set the_playlists to {"Joe Kubek", "J.J. Cale"}
if pick_random_pl then
set the_choice to some item of the_playlists
else
set the_choice to item 1 of (choose from list the_playlists with prompt ¬
"Pick a Playlist:" without multiple selections allowed and empty selection allowed)
end if

if pick_random_song then
set the_track to some track of playlist the_choice
else
set the_track to first track of playlist the_choice
end if
play the_track
end tell
--> cut <--


JBS
--
Liberty lies in the hearts of men and women; when it dies there, no constitution, no law, no court can save it.  -Learned Hand
_______________________________________________
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
References: 
 >Play a random playlist in iTunes (From: Michael Curtis <email@hidden>)

  • Prev by Date: Re: INDESIGN: Accessing the Content of Notes
  • Next by Date: Re: Result of Finder's POSIX path of (home as text) ends in slash?
  • Previous by thread: Play a random playlist in iTunes
  • Next by thread: Finder Copy to 'Cleanup At Startup' Folder in Leopard
  • Index(es):
    • Date
    • Thread