Make a number attribute "dAngle" and boolean "Clockwise?", and then insert something like that:
set Clockwise? to <false>
set dAngle to [Angle A - Angle B]
if <dAngle < 0>
set dAngle to [negate [dAngle]]
set Clockwise? to <not <Clockwise?>>
if <dAngle > 180> //another if, not "otherwise if"!
set dAngle to [360 - dAngle]
set Clockwise? to <not <Clockwise?>>
Thanks to these blocks dAngle should tell you what angle is between A and B, and which way should you go from one angle to another.
My Little Analysis tells me that it should work. If not, please let me know. If it does, also let me know.
Doesn't work afterall check for A= -140 B =120.
set Clockwise? to <false> (Clockwise?=false)
set dAngle to [-140 - 120] ( = -260)
if <dAngle < 0> (It is -260 < 0)
set dAngle to [negate [dAngle]] (260)
set Clockwise? to <not <Clockwise?>> ((Clockwise?=true))
if <dAngle > 180> //another if, not "otherwise if"! (It is 260>180 )
set dAngle to [360 - dAngle] (360 - 260 = 100)
set Clockwise? to <not <Clockwise?>>[/code] ((Clockwise?=false))
and it should be clockwise?=true.
dAngle is as it should be.