I developed a simple swift/cocoa application, and I am scripting it using system events. Sometimes when I click the button in my applescript the button stays pressed (with a blue color). Could it be related to the action the button does ? It is currently showing a progress window while in the background some files are uploaded. It does not happen all the time. I have tried putting more delay after the button click to allow it’s action to finish but it still happens sometimes.