On May 22, 2008, at 11:06 AM, Mark Lively wrote:
> Not easily. Its long been a problem that Apple Apps have crappy
> dictionaries.
>
> tell application "iTunes" to set albumlist to album of every track
> of playlist "Foo"
> set tid to AppleScript's text item delimiters
> set AppleScript's text item delimiters to linefeed
> set albumlist to albumlist as text
> set lun to open for access POSIX file "/tmp/foo" with write permission
> write albumlist to lun
> close access lun
> do shell script "sort -m /tmp/foo >/tmp/foo2"
Silly me. sort -u not -m
>
> set albumlist to read ("/tmp/foo2" as POSIX file)
> set albumlist to every text item of albumlist
> set AppleScript's text item delimiters to tid
> do shell script "rm -f /tmp/foo /tmp/foo2"
> set tracklist to {}
> repeat with anAlbum in albumlist
> tell application "iTunes" to set tracklist to tracklist & (name of
> every track of playlist "Foo" whose album is anAlbum)
> end repeat
> tracklist
-Mark
Wondering why the hell it was taking so long to run.