View Full Version : Itunes applescript.

Feb 28, 2013, 12:02 PM
Dear all

Newbie to this forum.
What I need is an apple script to open get info for al my movies in my iTunes and then close.

My library is on an external drive and my wife tried to access itunes without the drive being on. Ultimately once I had rectified this problem I noticed that the artwork for the majority of my movies was not visible. When I get info the artwork is there and if I close the artwork appears and stays.

I tried selecting all and then selecting get info but that did not work.

The only way it seems to work is if I individually get info on each movie and then close.

Thank you in advance for any help you may offer.


Feb 28, 2013, 04:51 PM
Open iTunes, and navigate to your movies.
Select List view, not 'Unwatched' or 'Genres'.
That'll give you a complete list of your movies.
Select the movie at the top of the list and Get Info.
The info dialog that shows up when invoked from list view has 'Next' and 'Previous' buttons on the bottom left that'll let you navigate between movies.

Feb 28, 2013, 05:58 PM
Try this :

tell application "iTunes"
reveal (some playlist whose special kind is Movies)
set theMoviesPlayList to (get some playlist whose special kind is Movies)
set theMovies to (tracks of theMoviesPlayList)
end tell
repeat with aMovie in theMovies
tell application "iTunes" to reveal aMovie
tell application "System Events"
tell process "iTunes"
key code 34 using command down
click button 1 of window 1
end tell
end tell
end repeat

You need to enable Enable access for assistive devices in Universal Access of System Preferences for this script to work.
To avoid doing this in the future you can create an Applescript app to start iTunes and put it into the Dock. Give it the iTunes icon and remove the current one from the Dock.

tell application "System Events"
if exists (disk "NameOfYourExternalDiskHere") then
launch application "iTunes"
display dialog "Disk \"NameOfYourExternalDiskHere\" is not connected. Itunes failed to launch" buttons {"OK"} default button 1
end if
end tell