The key tool here to use is Get ( WindowMode ). It returns 0 for Browse Mode and 1 for Find Mode
If [ Get ( windowMode ) = 0]
Put your script steps for browse mode here
Else If [ Get ( WindowMode ) = 1 ]
Put your script steps for find mode here
Do anything that needs to be done if you are in neither find nor browse mode here.
And you can use get ( WindowMode ) in a conditional format expression to change the color of the text to suit the current mode.
Thank you so much!