Itunes applescript.

Discussion in 'Mac Programming' started by evanhughes, Feb 28, 2013.

  1. evanhughes macrumors newbie

    Feb 28, 2013
    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.

  2. Partron22 macrumors 68020


    Apr 13, 2011
    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.
  3. kryten2, Feb 28, 2013
    Last edited: Feb 28, 2013

    kryten2 macrumors 6502a

    Mar 17, 2012
    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

Share This Page