Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mduser63

macrumors 68040
Original poster
Nov 9, 2004
3,042
31
Salt Lake City, UT
I'm trying to write a script that will set the video kind of the current track in iTunes to music video. I think it has to be done with GUI scripting. I'm fairly new to AppleScript, and very inexperienced with GUI scripting, and I'm having trouble. So far I've got the script below.

Code:
tell application "iTunes"
	activate
	set currTrackName to the name of the current track
end tell
tell application "System Events" to keystroke "i" using command down
tell application "System Events"
	tell process "iTunes"
		try
			tell tab group 1 of window currTrackName
				click radio button "Options"
				delay 1
				click menu item "Music Video" of menu 1 of pop up button 1 of group 1
			end tell
		end try
	end tell
end tell

It opens the Get Info window and clicks the "Options" tab, but for some reason the pane where the options should be never fills in. If you take focus away from iTunes, it will fill in the pane, but what appears is the default view (ie last selected view) in the Get Info box. It's a little hard to explain, but it should be clear if you run it yourself. Can anyone figure out what I'm doing wrong or how to get around the problem I'm encountering?
Alternatively, has anyone already written a script that will set the video kind of video tracks to music video (preferably multiple tracks at once)?

In case it matters, I'm running 10.4.3 and iTunes 6.0.1.
 

mduser63

macrumors 68040
Original poster
Nov 9, 2004
3,042
31
Salt Lake City, UT
For the benefit of anyone who finds this later, I got an answer to an identical post on Apple Discussions. Still not sure why my script doesn't work, but the script provided in that thread does work.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.