Page 1 of 1

How to check if a checkbox button is true or false?

Posted: Fri Jan 06, 2012 2:59 pm
by 3d-swiss
I've create a button as Checkbox and named it 'bTXTDatei'.

On a script of a push button I like to check, if 'bTXTDatei' is True or False like this:

Code: Select all


on mouseUp
   if  button "bTXTDatei" is true then  -- here is the problem, that is always FALSE
      -- use .txt as extension
   else
      -- use .vcf as extension
   end if
end mouseUp
Where is my mistake. How can I check, if the Checkbox is set/true or unset/false?

Best regards from Switzerland

Re: How to check if a checkbox button is true or false?

Posted: Fri Jan 06, 2012 3:47 pm
by gpb01
Hi from Switzerland (Locarno),

use the "hilite" http://docs.runrev.com/Property/hilite property ...

if the hilite of button "MyButton" then ...

or, if the script is inside the checkbox you can use : if the hilite of me then ....

In your sample :

Code: Select all

    on mouseUp
       if the hilite of button "bTXTDatei" then
          -- use .txt as extension
       else
          -- use .vcf as extension
       end if
    end mouseUp
Guglielmo