MACSCRPT Archives

May 2008

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Lively <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Thu, 22 May 2008 11:06:35 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (38 lines)
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"
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




On May 22, 2008, at 10:29 AM, Chuck Pelto wrote:

> Greetings All,
>
> What is the call necessary to get iTunes to sort a playlist by album  
> title?
>
> Regards,
>
> Chuck
>

ATOM RSS1 RSS2