Thursday, January 18, 2018

#1 2011-03-03 07:26:45 pm

AudialRedux
Member
Registered: 2010-12-08
Posts: 45

CheckBox table HELP!

HHHHHHHHHHHHHEEEEEEEEEEEEEEEEELLLLLLLLLLLLLLLLPPPPPPPPPPPPPP!!!!!!!!!!!!!!

Applescript:

if check box "hello" of window "Main" is true then
say hello using "alex"
else if
if check box "hello" of window "Main" is false then
-- Do nothing
set hello to hello
end if
end if

this is some of the code:
the main idea is that i when a user checks a check box the computer says "Hello" but if its unchecked i want it to do nothing.

PLEASE HELP!!!! YOUR NAME WILL APPEAR IN MY PROGRAM ABOUT BOX IF FIXED!!!!!

Offline

 

#2 2011-03-04 01:14:13 am

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11483
Website

Re: CheckBox table HELP!

Hi,

Xcode comes with a hugh documentation, where all classes and methods are described in-depth.

A check box is technically a button, you can see the class (NSButton) in the inspector window.
A button object can not be true or false, it has a property state, which indicates the three possible states (Off, On, Mixed) of a button as an integer value

Applescript:


if state of button "hello" of window "Main" is 1 then
   say hello using "alex"
end if


regards

Stefan

Offline

 

#3 2011-03-04 06:09:38 am

DJ Bazzie Wazzie
Member
From:: the Netherlands
Registered: 2004-10-20
Posts: 2728
Website

Re: CheckBox table HELP!

Stefan's post is correct and this is just another way with the same results

Applescript:

if (if state of button "hello" of window "Main" as boolean) then
say hello using "alex"
end if

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)