• 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: Grab list of album names in iTunes?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Grab list of album names in iTunes?


  • Subject: Re: Grab list of album names in iTunes?
  • From: Graff <email@hidden>
  • Date: Tue, 03 Feb 2004 14:54:31 -0500

This seems to work for me:
-------------
tell application "iTunes"
album of every track of playlist "Library"
end tell
-------------

This will return an unsorted list that has duplicate album names. You still have to remove the duplicates on your own. I suggest writing to a file and then using the shell commands "sort" and "unique". Here's an example:
-------------
tell application "iTunes"
set albumList to album of every track of playlist "Library"
end tell

set filePath to ((path to desktop) as text) & "Test"
set theWriteFile to open for access filePath with write permission
set {oldDelims, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ASCII character 10}
write (albumList as text) to theWriteFile
set AppleScript's text item delimiters to oldDelims
close theWriteFile

set filePOSIX to quoted form of POSIX path of filePath
set uniqueText to do shell script "sort -f " & filePOSIX & " | uniq"
set uniqueList to every paragraph of uniqueText
-------------

- Ken

On Feb 3, 2004, at 1:45 PM, Mark Dawson wrote:

I'd like to compile a list (unique) of albums in my iTunes library. Is there a way to do this? I could do a loop for every track and access the "album" part of the track, but that would give me lots of duplicate album names.

Thanks!

Mark
email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Grab list of album names in iTunes?
      • From: Andrew Oliver <email@hidden>
References: 
 >Grab list of album names in iTunes? (From: Mark Dawson <email@hidden>)

  • Prev by Date: Re: Multiline commands in do shell script
  • Next by Date: ANNOUNCE: XSLT Tools 2.0
  • Previous by thread: Grab list of album names in iTunes?
  • Next by thread: Re: Grab list of album names in iTunes?
  • Index(es):
    • Date
    • Thread