This is a quick hack example based on the Adobe CS6 sample code, where two tools toggle on a thread. You probably should agree to whatever Adobe SDK agreements there are before reading this code.