Search code examples
applescriptitunesunselectdeselect

Applescript: deselect current selection in iTunes


I want to unselect the current selection in iTunes using Applescript. Is that possible?

This is what I do

  1. Manually select several tracks in iTunes.
  2. Launch the script (actually a Automator service) that stores the selection in a list.
  3. Now I want to display the info window of the first track in the selection.

Currently I do this buy sending a key combo to iTunes. The problem is that when I have several tracks selected the info window iTunes opens are for all selected tracks.


Solution

  • tell application "iTunes"
        set sel to (get selection)
        # ... do something with sel ...
        reveal (get item 1 of sel)
    end tell