SCRIPT: Check a checkbox in Xcode

Reason number #8499 why i love KM.

So for years, in xcode, i press a key combo and it shows me all the files i will commit to git.

But, while the button on the right is auto default, for me at least I like to make sure I push it to the cloud.

I tried various ways but then discovered, using applescript, how to select and check a checkbox control so here it is,

add an "Applescript" type action to your macro, then use this code:

tell application "System Events"
	tell process "Xcode"
		click checkbox "Push To Remote:" of sheet 1 of window 1
	end tell
end tell

The git window is a sheet, that's why "sheet 1" is in there.

Hope this helps others.

Thanks for sharing.
I moved your topic to the "Macro Library" where we normally post macros and scripts that are provided as solutions.
Also, I revised your post to put the AppleScript in a Forum Code Block.

1 Like