When UI Scripting in Applescript, you might want to tick a checkbox:
tell application "System Events"
tell process "Example Process"
click checkbox "Example Checkbox" of sheet 1 of window 1
end tell
end tell
This has a problem. If the example checkbox is already ticked, you actually un-tick the box. How can you "tick the checkbox only if it's not already ticked"?