PDA

View Full Version : Scripters Tip - Selected with Shuffle Off


Doug Adams
08-09-2003, 03:11 PM
Here's something I hadn't realized: if you are using selection, check beforehand to make sure shuffle of view of front window is off, otherwise, your selected tracks will also be shuffled. This may not be what you had in mind, especially if you are doing a "repeat with i from 1 to (count of items of selection)". You know?

tell application "iTunes"
if shuffle of view of front window is false then
if selection is not {} then
-- do stuff with selection
else
-- no selection...
end if
else
-- shuffle is on...
end if
end tell

If you don't care about the order of tracks in the selection, then you needn't bother checking on shuffle.