I have been trying to figure this out for a few days now and still cannot understand how this works.
I have created a new AppleScript Project in Xcode version 13.4.1 and added a CheckBox and a Button. My goal is to try and so something depending on whether the CheckBox is Ticked or Un-Ticked.
I am extremely new to Xcode so I am most likely doing something wrong. The reason for not showing real code is that I have nothing that works so I am asking if anyone can help me learn this by filling in the missing gaps.
The documentation for Xcode Applescript object seems thin on the ground to me or at least that's what I am finding.
Thank you
property checkBox : 1 -- bound to the value of the check box & is ticked when run
#START BUTTON
on startButtonClick_(sender)
-- if checkbox is ticked then show alert "ticked"
-- if checkbox is NOT ticked then show alert "NOT ticked"
end startButtonClick_
Update
It was suggested that including real code would be more useful which I do agree with so here is the latest attempt I have tried.
property checkBox : missing value -- bound to the value of the check box
#START BUTTON
on startButtonClick_(sender)
set checkBox to (checkBox as boolean) -- toggle
if checkBox is 1 then display alert "Ticked"
log checkBox
end startButtonClick_
The alert never shows but yet the log output shows 1 when the checkbox is ticked and 0 when its unticked when I press the button