UI Scripting: click broken in 10.9 -NOT an accessibility pref. issue

I had the following script working fine until upgrading to Mavericks, to semi-automating saving Keynote presentations as PDFs with specific settings:

tell application "System Events"
	tell application process "Keynote"
		set frontmost to true
		
		repeat until window 1 exists
		end repeat
		
		-- Hide Inspector if visible	
		if menu item "Hide Inspector" of menu 1 of menu bar item "View" of menu bar 1 exists then
			keystroke "i" using {command down, option down}
		end if
		
		-- Print; wait until the sheet is visible	
		click menu item "Print." of menu 1 of menu bar item "File" of menu bar 1
		
		repeat until sheet 1 of window 1 exists
		end repeat
		
		click ((pop up buttons of sheet 1 of window 1) whose description is "Presets")
		click menu item "6x" of menu of ((pop up buttons of sheet 1 of window 1) whose description is "Presets") --replace if desired with your preferred preset
		
		if value of (checkbox 1 of sheet 1 of window 1) is 0 then
			click (checkbox 1 of sheet 1 of window 1)
		end if --set to print selected slides only -- you can use the same technique to adjust other checkboxes as desired
		
		click radio button "Individual Slides" of radio group 1 of sheet 1 of window 1 --replace to suit your needs
		
		click menu button "PDF" of sheet 1 of window 1
		click menu item "Save as PDF." of menu 1 of menu button "PDF" of sheet 1 of window 1 -- Save as PDF...
	end tell
end tell

end open

This worked fine. Now, when I run it, I get the message

System Events got an error: every pop up button of sheet 1 of window 1 of application process “Keynote” whose description = “Presets” doesn’t understand the “click” message.

on the line

click ((pop up buttons of sheet 1 of window 1) whose description is "Presets")

I’ve found a couple of other posts that make me think that click has stopped working for some UI elements in Mavericks. It clearly still works for some items, & accessibility prefs. are ok, b/c the prior click menu item command runs fine.

Any help would be much appreciated!

Try :
set thePopUp to first pop up button of sheet 1 of window 1 whose description is “Presets”
click thePopUp
click menu item “6x” of menu 1 of thePopUp–replace if desired with your preferred preset

Yvan KOENIG (VALLAURIS, France) vendredi 31 janvier 2014 14:54:35

Thanks for the help! This works perfectly. Not sure why it would change in Mavericks but glad to find a solution! :):):slight_smile:

I use the syntax
first pop up button of sheet 1 of window 1 whose description is “Presets”
for years.

I don’t understand how a script would be able to click:
(every pop up button of sheet 1 of window 1 whose description is “Presets”)
as you were asking it to do.

The error message was explicit (no, not like Miley Cyrus)
System Events got an error:
every pop up button of sheet 1 of window 1 of application process “Keynote” whose description = "Presets"
doesn’t understand the “click” message.

I used a variable just to don’t scan twice the set of pop up buttons.

Yvan KOENIG (VALLAURIS, France) vendredi 31 janvier 2014 21:45:55

Yeah, the every line doesn’t make a lot of sense now that I look at it…but it had worked fine for me for 9 months or so, until I upgraded to Mavericks.