Is there a way to specify that numbers being typed by a macro, are typed as if entered on the number pad?
I work in Pro Tools for editing audio. I can leave markers at certain locations. To recall a marker, and move to its location I can enter a key sequence. The key sequence is “Numpad Period, Numpad Number, Numpad Period” So if I want to go to marker 40 it would be “Numpad Period, Numpad 4, Numpad 0, Numpad Period”.
I have a lot of great little macros I’ve written for Pro Tools. I’m trying to work out a way to apply these macros multiple times rather that firing them individually. So I could setup markers and apply them to the audio at a set of markers.
I have everything working except for making it automatically locate to the markers. I can hard program a single one with no problem. But if I want it to loop through say the first ten markers, I need a loop with a calculation and a counter, incrementing my marker number. Easy enough to do if it were entering just regular numbers. But it must be numbers typed on the number pad for Pro Tools to recognize the key sequence and locate to the marker.
I hope that makes sense. If not currently implemented, I think it could be done with a preference or maybe setting for the “Enter Text by Typing” action that would make all numbers typed be sent as numpad numbers.
Let me know if there is currently a way to do this, otherwise it is a feature request. As always. I love Keyboard Maestro. Great Software. Amazing job.
Thanks for the reply. I have used the action you demonstrated. However I need to able to have the macro make calculations and then type out the numbers. So the numbers can’t be hard programmed. They need to be variables.
No, there is no way to specify which of the keys that makes the desired character is pressed. There isn’t even any real guarantee as to whether the main keyboard or the number pad will be pressed, it could be either. Keyboard Maestro doesn’t “know” anything about the keyboard, it just looks at the keyboard map and reverse maps it to figure out what keys to press to get the desired result. There aren’t any special casing as to which keys if two keys can both generate the desired result.
Instead, if you need this specifically, I suggest you make a sub-macro that takes a digit and uses a Switch statement to press the appropriate number pad key. So something like:
switch text %TriggerValue% of
Type Number Pad 0
Type Number Pad 1
Type Number Pad 2
Type Number Pad .
Then you could use For Each substring in regex (.) and pass it to that sub-macro and type the appropriate key as required.
Peter thank you so much for your help! Your response has put me on what I believe to be the right track. I'm trying to debug my submacro right now, and I am stumped. Perhaps you'd be willing to help.
It seems to have issues with zeros and repeating numbers. It is working fine in Pro Tools. But to see the output I'm testing it in a text editor. So if I try to have it cycle through markers 9-15 it should send the following keypad commands:
Instead it outputs this:
Same thing for 19-25 and so on:
Should be: .19..20..21..22..23..24..25.
For numbers 100-110 it should be:
but it outputs:
Swapping out my switches in the submacro for a simple insert text by typing action, it outputs the correct digits. So I feel it is being passed the correct numbers in order, but something about the switches or the order is messing things up.
There are other changes to cleanup/optimize the macros.
Here are my versions, which I hope will serve as a guide for you.
Please let us know if this works for you, and/or you have questions.
###MACRO: Cycle Through Markers @JMichaelTX
~~~ VER: 1.0 2017-09-15 ~~~
<a class="attachment" href="/uploads/default/original/2X/d/d86dac6805e07937348494231d392df4314be5db.kmmacros">Cycle Through Markers @JMichaelTX.kmmacros</a> (5.7 KB)
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**
<img src="/uploads/default/original/2X/a/a68eafe8f220e55acaa244826c92d746a2bcc5c0.png" width="612" height="1517">
Wow Thank you so much! I really appreciate your help. Your macros work perfectly. I’m learning a lot about optimization by looking through examples. I certainly can improve in the design and efficiency of my macros. I very much use one action per task and go step by step. So it is extremely helpful to see how someone with your skill would do it.
I still am not sure as to why my method wouldn’t work, but I can definitely see how it would be more prone to error with the way that it is setup. Just for my knowledge, is there anything that pops out to you as to what was causing the numbers to output incorrectly?
But the way you are doing it with the For each and while is much better. I think in my head I’m programming the math and action into the macro, whether than understanding all the actions available that can do that work for me.
Either way, thank you very much. This will certainly work for the tasks I have in mind for it.
Also the %ExecutingMacro% for the title of the prompt blew my mind. Didn’t know about that one! Thanks
I believe the main cause was that you were not calling the keypad macro for EACH character in the ConformMarker. Also, in the keypad sub-macro you were using “match” instead of “is” (which means equal to). “Match” invokes the RegEx engine to match the first character.
Hi. I’ve been trying to follow this thread as I also want to type numbers on the Numpad to use in a (much simpler) Pro Tools macro, but the discussion is going way over my head. I wonder if you could help me make a macro that does the following:
Prompt for user input: “Edit No” (up to 3 digit number)
Type: numpad .
Type variable “Edit no” on the numpad
Type: numpad .
click at a point on the screen
Type: numpad .
Type numpad5 then edit number on the numeric keypad
Type: numpad .
So the macro would first promt me to enter a number then do ". ### . click at location . 5### .
I know how to type the . and click at a location, it’s just the typing a variable number on the numpad that I’m stuck with.
If you could help me do that I would be eternally grateful!
That could similarly be made into a Sub-Macro like @JMichaelTX's macro. And then called from a macro that performed the steps you outline (make sure you have a pause before/after the click if necessary).