• 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: reiterating over a playlist
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reiterating over a playlist


  • Subject: Re: reiterating over a playlist
  • From: Jon Pugh via AppleScript-Users <email@hidden>
  • Date: Sat, 18 Apr 2020 18:02:43 -0700

On Apr 18, 2020, at 2:40 PM, iKel via AppleScript-Users
<email@hidden> wrote:
>
> song by artist

tell application "iTunes"
        tell playlist "The Hits"
                set trackItems to {name, artist} of every track
        end tell
end tell
set itemCount to number of items in item 1 of trackItems
set outputString to {}
repeat with i from 1 to itemCount
        set itemSong to item i of item 1 of trackItems
        set itemArtist to item i of item 2 of trackItems
        set itemLine to itemSong & " by " & itemArtist
        copy itemLine to end of outputString
end repeat
set text item delimiters to return
outputString as string


Jon

 _______________________________________________
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: 
 >reiterating over a playlist (From: iKel via AppleScript-Users <email@hidden>)

  • Prev by Date: Re: How do I use if/then with this Apple Mail script?
  • Next by Date: Re: reiterating over a playlist
  • Previous by thread: reiterating over a playlist
  • Next by thread: Re: reiterating over a playlist
  • Index(es):
    • Date
    • Thread