Re: Control structure with "not"

2015-08-04 Thread Peter Haworth
Maybe I'm misunderstanding what you want but I think my code does that. For example, let's say tSender is "Apple": set tSwitchApple to (tSender is not "Apple") --> false set tSwitchPeach to (tSender is not "Peach") --> true set tSwitchGrape to (tSender is not "Grape") --> true Looking at your co

Re: Control structure with "not"

2015-08-04 Thread Phil Davis
You can always use 'switch' without specifying an expression to evaluate as part of the 'switch' line, like so: switch case (tSender is not "Apple") put true into tSwitchApple --break case (tSender is not "Peach") put true into tSwitchPeach

Re: Control structure with "not"

2015-08-04 Thread Peter Bogdanoff
This won’t work for me because ALL the switches always have to be set to true, except for the one related sender. On Aug 4, 2015, at 2:40 PM, Peter Haworth wrote: > You could: > > set tSwitchApple to (tSender is not "Apple") > set tSwitchPeach to (tSender is not "Peach") > set tSwitchGrape to

Re: Control structure with "not"

2015-08-04 Thread dunbarx
Hi. Your if-then would be better served as: on doThisThing tSender if tSender is not “Apple” then set tSwitchApple to true else if Sender is not “Peach” then set tSwitchPeach to true else if Sender is not “Grape” then set tSwitchGrape to true end doThisThing The switc

Re: Control structure with "not"

2015-08-04 Thread Scott Rossi
One option, if I understand what you're asking: on doThisThing tSender repeat for each item theVar in "Apple,Peach,Grape" do "put (tSender <> theVar) into" && ("tSwitch" & theVar) end repeat end doThisThing Regards, Scott Rossi Creative Director Tactile Media, UX/UI Design On 8/

Re: Control structure with "not"

2015-08-04 Thread Peter Haworth
You could: set tSwitchApple to (tSender is not "Apple") set tSwitchPeach to (tSender is not "Peach") set tSwitchGrape to (tSender is not "Grape") Slightly different than your code because the switches would be set to false if the condition isn't met whereas you code doesn't do that. On Tue, Aug