Re: reiterating over a playlist
Re: reiterating over a playlist
- Subject: Re: reiterating over a playlist
- From: Christian Boyce via AppleScript-Users <email@hidden>
- Date: Sat, 18 Apr 2020 19:25:05 -0700
Try this:
set SongItems to ""
tell application "Music"
set thePlaylist to playlist “Today at Apple"
set theTracks to every track of thePlaylist
repeat with aTrack in theTracks
set theArtist to artist of aTrack
set theTrackName to name of aTrack
set SongItems to SongItems & return & theTrackName & " by " &
theArtist
end repeat
end tell
tell application "TextEdit"
activate
make new document with properties {name:"Today at Apple"}
set text of document 1 to SongItems
end tell
> On Apr 18, 2020, at 2:40 PM, iKel via AppleScript-Users
> <email@hidden> wrote:
>
> Hello!
> I am trying to iterate over a playlist and this is what I have thus far. I
> cannot seem to get it down. Maybe this is
> not the best way to do it but what I am trying to do is to a iterate over a
> playlist and get both the artist and song
> separated by the word “by”.
—
Socially distantly yours,
<https://christianboyce.com/>
Check out our latest blog posts!
• Top 10 things to do to maximize your Mac’s performance
<https://christianboyce.com/7-things-to-do-when-setting-up-a-new-mac/>
• Mac Mastery Series: Save Time and Effort with Smart Folders
<https://christianboyce.com/save-time-effort-smart-folders-saved-search/>
• Mac Mastery Series: Save Time and Make Things Easier by Customizing the
Finder’s Toolbar <https://christianboyce.com/customize-toolbar-finder-mac/>
• Mac Mastery Series: New Folder with Selection
<https://christianboyce.com/new-folder-with-selection/>
• Mac Mastery Series: Rename Multiple Items at Once
<https://christianboyce.com/finder-rename-multiple-items/>
_______________________________________________
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