I have configured the shortcut ⌘+F to trigger an applescript that must type "Always" very quickly (tell application "System Events" to keystroke "Always")
I am experiencing some problems when the keystroke is typed while I am still pressing the cmd key.
Is there any way/workaround to virtually release the cmd key? Or is it possible to delay the triggering of the applescript until I release the cmd key? Any idea?
In this case you would press Cmd (down/up) and then “F.” Thanks to the variable, the “F” won't be typed, as if cmd were still held down. But since cmd is released, it shouldn't cause problems ... maybe
there is a new action category in current BTT versions that allows you to trigger when releasing all modifier keys
Alternatively try the „set / press / release modifier keys“ action as first action in your sequence, it can release the cmd key before running the apple script - you might need to experiment a bit with the action‘s settings
@jordikt , just out of curiosity - is this the only action this script does? If yes, why you are not using BTT's action - "Insert / Type / Paste Custom Text"?
Thanks @Frank1 for you sugegestions. The delay is not a solution, but variable can be an alternative if the actions that Andreas told are not a good oslution
I've said it many times, but I'll say it again. Look, I've been using BTT for years, but BTT always surprises me with new features that I don't know about. I wonder if even Andreas has the list of everything this application can do in his head…
I can delay one second the applescript to be triggered, but it doesn't fix nothing if I hold the cmd key for more than one second.
When I press a shortcut, I always quickly release the non-modifier key, but I tend to hold down the modifier key longer. That's why the delay can fail me.
Nah, I'm not talking about a solution or making a difference, just tryign to understand why if the script does only that you are not using BTT's action. Like mention - just out of curiosity (well actually maybe this will come in handy in the future for myself as well ). Maybe you've hit some issue with BTT's action or there's specific use-case which you have.