From the Apple Documention on “set”:
set x to {8, 94133, {firstName:"John", lastName:"Chapman"}}
set {p, q, r} to x
(* now p, q, and r have these values:
p = 8
q = 94133
r = {firstName:"John", lastName:"Chapman"} *)
set {p, q, {lastName:r}} to x
(* now p, q, and r have these values: p = 8
q = 94133
r = "Chapman" *)
Now, I’m wishing to do the same basic thing, cept I want to set the state of multiple buttons (check boxes) to 0.
This is my code:
on clicked theObject
if the name of theObject = "advanced" then
set panelWIndow to window "advancedSettings"
display panel panelWIndow attached to window "main"
else if the name of theObject = "applySettings" then
close panel (window of theObject) with result 1
--Insert Program Switch Assignment Here--
else if the name of theObject = "bfloat" then
set state of button {"bshort", "buchar"} of window "main" to 0
end if
end clicked
I receive the following error:
The code works as expected if only a single button is listed (set state of button “buchar” of window “main”…).I’m sure it’s some silly syntax mistake I’m making, I’m new to applescript. But if anyone could point me in the right direction I’d appreciate it.
edit I realize the error code means “cannot make into expected type”…not sure what to do about it though.