Jump to content

Click MenuBar Item in Frontmost App vs Dispatch Key Combo

Recommended Posts

I have a workflow I'm building that can use either -- it is a Item in an edit menu but also has a shortcut assigned? Is one faster? more reliable/preferable?

also if I wanted to select the same menu item multiple times in succession is there a way to repeat it x amount of times like dispatching a hot key? Or do I just need to copy that objects amount of times.


Edited by sepulchra
Link to comment

For the goal you’re after, neither is exactly GUI Automation (they’re more reliable than that) but they are adjacent. For example, does the app itself handle multiple sequential triggers? You’ll know by trying. Also, consider when sharing. On the one hand, users can change their app shortcuts so sending key presses may not do what you want. On the other hand, if their system is not in English, the text you use for clicking will also not be the same (which is why Tapback Message has the configuration to change it). On the other other hand, a keyboard shortcut may do multiple things in an app depending on context. On the other other other hand (wait, how many hands is that?) maybe you only want one of those multiple actions to trigger so not supporting them all is a feature.

In terms of raw speed, pressing the shortcut might be a tad faster. Clicking the menubar item requires AppleScript, which is a bit slow, but not so slow that you’ll notice it. And again, being too fast can be a disadvantage if the app can’t take it. Which is another thing, you still need to think of the app’s own reaction time.

In short: it depends and the right answer is contextual. If you’re only doing it for yourself, don’t fret about it. If you’re sharing it, I’d give serious thought about the Tapback Message approach, because you definitely do not want to be debugging if someone else changed an app shortcut, or worse: if the one you set they have to trigger something else. In the best case scenario, the app can be automated via AppleScript or another method.

Link to comment

not surprisingly @vitor this has sent me down a bit of a rabbit hole after looking at your Tapback Message workflow. One part of the workflow requires that i fire number keys on the numpad. It is a shortcut I am trying to fire in pro tools (the digital audio workstation app that I use). In order to go to a marker one has to type the "." key and the marker # on the numeric keypad. The numbers can be 1 digit or 6 digits long. For exmple say you want to go to marker #5. the keycommand to go to that marker would be ".5."    


I want to be able to use this in a script that is then followed by other objects downstream. I thought I use use a variable to store the value (like in tapback) and pass to the dispatch keycombo, but there is no way to specify a numpad key with it is passed that way, correct? I'm guessing I would have to build a list filter where the possible numpad combos are assigned a keycode value and get saved as variables?


Bring on the rabbit holes. 





Edited by sepulchra
Link to comment

wow! that is really great but i think in this case because pro tools see numbers on the numpad and numbers below f keys as separate keys, I think I would still need a way to pass keycodes.... but so grateful you keep adding new automation tasks!!!

Edited by sepulchra
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...