• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Clicking iTunes 10 Genius button?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clicking iTunes 10 Genius button?


  • Subject: Re: Clicking iTunes 10 Genius button?
  • From: "David A. Cox" <email@hidden>
  • Date: Fri, 3 Sep 2010 09:54:14 -0700
  • Acceptlanguage: en-US
  • Thread-topic: Clicking iTunes 10 Genius button?

I went through the same pains with version 9 of iTunes, and it looks like iTunes 10 has the same issue, so I was wondering if anyone had any new ideas about how to target a specific button in GUI scripting in iTunes.

The basic problem is that iTunes dictionary does not have a way to start a genius playlist. GUI scripting can be used to select menu items and click buttons, which is a good work around for most things. But there is no "start genius playlist" menu item or keyboard shortcut (that I have found), and the button for activating this feature does not have any unique information about it (like name or help info) that I can read with applescript. There is a mouse-over tool tip that is unique, but I have not found a way to read that with applescript (it used to be the "help" of a button, but not any more).

On my stock system, the genius button seems to be button number 10 on my window, but I am not sure what events may change that (in version 9 the presence of a burnable disk would change the number of the genius button).

I have made a request for a feature enhancement via the apples web form, but I am sure this is not going to be high up on their priority list. Does anyone have any clever ideas or information about something I am missing?

Thanks,

DAC

On Sep 11, 2009, at 3:17 PM, David A. Cox wrote:

> I have not seen any ideas on this list yet, so for I thought I would
> share a little bit of crufty work around I have worked up for myself
> (but it seem too delicate to send off to people):
>
> -------------
> tell application "iTunes"
> 		activate
> 		--Get the version of iTunes, so we can mix 8 and 9 installs for now
> 		set this_version to the version as number
> end tell
>
> tell application "System Events"
> 	tell process "iTunes"
> 		keystroke "l" using command down --this draws focus to the active song
> 		if this_version is less than 9.0 then
> 			click (the first button of window "iTunes" whose help is "Start
> Genius.") --this clicks the genius button
> 		else --This else statement is lame, as the buttons move around
> depending on conditions. We need a way to target the button directly
> 			set buttonTitles to title of every button of window "iTunes"
> 			if buttonTitles contains "Burn Disc" then
> 				click button 17 of window "iTunes"
> 			else
> 				click button 16 of window "iTunes"
> 			end if
> 		end if
> 		keystroke "l" using command down --this draws focus to the now
> active genius playlist.
> 	end tell
> end tell
> --------------
>
> It might be more robust to always click the button that is one less
> than the total, but this was the path I went down with the most common
> 'disruptor' to the regular button count. A real solution would be
> great....
>
> DAC
>
> On Sep 9, 2009, at 3:38 PM, David A. Cox wrote:
>
>> This worked in iTunes 8 (if a song is playing in iTunes):
>>
>> tell application "System Events"
>> 	tell process "iTunes"
>> 		keystroke "l" using command down --this draws focus to the active
>> song
>> 		click (the first button of window "iTunes" whose help is "Start
>> Genius.") --this clicks the genius button
>> 		keystroke "l" using command down --this draws focus to the now
>> active genius playlist.
>> 	end tell
>> end tell
>>
>> But this does not seem to work in iTunes 9, as all of the buttons have
>> a missing value for their "help". I have not seen any other way to
>> find the button with UI scripting (finding it by count does not always
>> work as the number of buttons or layout may change). It would be
>> better if there was direct way to start a genius playlist, but I have
>> not seen that either.
>>
>> Anyone have a way to do this?
>>
>> DAC
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> AppleScript-Users mailing list      (applescript-
>> email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> Archives: http://lists.apple.com/archives/applescript-users
>>
>> This email sent to email@hidden
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Library Modules and Library Loaders
  • Next by Date: Re: Sortin an alias list by path
  • Previous by thread: Re: Sortin an alias list by path
  • Next by thread: File path of a file
  • Index(es):
    • Date
    • Thread