Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Create an iTunes Genius playlist via keyboard shortcut Apps
Something Apple really messed up with in iTunes 8 is that there is no keyboard shortcut or menu item to create a Genius playlist. You can enable the feature via the menus, but to actually create a Genius playlist, you need to click the Genius button at the bottom of the main iTunes window. Despite much searching, I wasn't able to find a solution to this problem. Fortunately, I finally figured out how to automate activating Genius using an AppleScript.

tell application "iTunes"
 activate
 set the_song to the selection
 play item 1 of the selection
end tell
tell application "System Events"
 click button 3 of scroll area 1 of window "iTunes" of application process "iTunes"
end tell
The script will use the currently selected song (Command-L will select the currently-playing song) as the basis for your genius playlist. By combining this script with your favorite keyboard macro program (mine is Spark), you can activate Genius with a simple keyboard shortcut (I used Cmd-Option-G). This was originally posted in this entry on my blog.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[7,799 views]  

Create an iTunes Genius playlist via keyboard shortcut | 7 comments | Create New Account
Click here to return to the 'Create an iTunes Genius playlist via keyboard shortcut' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create an iTunes Genius playlist via keyboard shortcut
Authored by: tchenj on Aug 06, '09 10:54:30AM

Thank you! I've been looking for a way to do this forever!
I got really interested in scripting after reading this post and I played with the script a bit, not sure exactly what I did, but after some random changes I saved

tell application "iTunes"
activate
end tell
tell application "System Events"
click button 3 of scroll area 1 of window "iTunes" of application process "iTunes"
end tell

as an application (Genius) in the folder Library > iTunes > Scripts
then I went to System Preferences, Keyboard and Mouse, Shortcuts, and assigned Cmd + G to Genius!
Now when any song is playing I just hit Cmd + G and it makes a Genius playlist!!
Thank you again for this über useful script :)



[ Reply to This | # ]
iPhone Big Screen
Authored by: richard220 on Aug 07, '09 06:47:19AM

Recently, my battery was about to die and I was trying to plug my iPhone into its charger when I noticed that everything on the screen had become so big that I could barely make anything out. It was as if the fonts had gone from 10pt to 500pt. I tried to scroll around but even tat was nearly impossible. I could still receive calls but could not do much else.

After trying everything I could think of including turning the phone off and on several times, I broke down and called Applecare.

The solution...tap the screen with 3 fingers 3 times. I know it sounds crazy but it worked! My screen went back to normal.



[ Reply to This | # ]
Create an iTunes Genius playlist via keyboard shortcut
Authored by: tstrand@tlsb.com on Aug 09, '09 07:21:45AM

I get the following error when running this script:

Can't get window "iTunes" of ≪class pcap≫ "iTunes" of application "System Events".

iTunes 8.2.1 / OS X 10.5.8

Tom



[ Reply to This | # ]
Create an iTunes Genius playlist via keyboard shortcut
Authored by: RBFFan123 on Nov 25, '09 10:39:28AM

I am having the same problem as Tom.

iTunes 9.0.2 / 10.6.2



[ Reply to This | # ]
Create an iTunes Genius playlist via keyboard shortcut
Authored by: hrko on Sep 13, '10 03:34:09PM
Late to the party, I know, but maybe more people are looking for something like this. I am new to AppleScript so I am not sure this is the most elegant solution but it works for (iTunes X on Snow Leopard). This might create some errors if you dont have a track selected/playing or are not in a playlist/Music section like the iTunes store. It also checks if 'Enable access for assistive devices' is on, which should fix the problems some of the commenters had (I think).
tell application "System Events" to set isUIScriptingEnabled to UI elements enabled
if isUIScriptingEnabled = false then
	tell application "System Preferences"
		activate
		set current pane to pane "com.apple.preference.universalaccess"
		display dialog "Your system is not properly configured to run this script. Please select the 
		\"Enable access for assistive devices\" checkbox and trigger the script again to proceed."
		return
	end tell
end if

tell application "iTunes"
	activate
	if player state is playing then
		tell application "System Events" to keystroke "l" using command down
		set the_song to the current track
		play the_song
	end if
end tell

tell application "System Events"
	tell process "iTunes"
		repeat with the_button in every button of window 1
			set the_props to properties of the_button
			if description of the_props is "genius" then
				click the_button
				return
			end if
		end repeat
	end tell
end tell


[ Reply to This | # ]
Create an iTunes Genius playlist via keyboard shortcut
Authored by: ptujec on Jan 20, '11 02:33:56PM
Thanks! That actually helped! Thats what I am using:
-- iTunes - New Genius Playlist
--
-- source: http://www.macosxhints.com/article.php?story=20090805072808180
-- The script will use the currently selected song as the basis for your genius playlist. 
-- Checks if iTunes is hidden and keeps that way after script is done.
--
-- edited by ptujec
-- last edited 2011-01-20


tell application "System Events"
	try
		if visible of process "iTunes" is true then
			set okflag to true
		else
			set okflag to false
		end if
		
		
		tell application "iTunes"
			activate
			reveal current track
		end tell
	end try
	
	my _action()
	
	if okflag is false then
		set visible of process "iTunes" to false
	end if
	
end tell --

on _action()
	try
		tell application "System Events"
			
			tell process "iTunes"
				repeat with the_button in every button of window 1
					set the_props to properties of the_button
					if description of the_props is "genius" then
						click the_button
						-- return
					end if
				end repeat
			end tell
		end tell
	end try
end _action


[ Reply to This | # ]
Create an iTunes Genius playlist via keyboard shortcut
Authored by: ptujec on Jan 22, '11 07:58:51AM

Here is another one based on it:
http://ptujec.tumblr.com/post/2874324070/itunes-new-random-genius-playlist-script



[ Reply to This | # ]