Assigning Variable To use for Pause Duration

Hi, I am relatively new to Keyboard Maestro. I am creating a macro that uses many pauses in between clicking on found images to allow time for the computer to catch up (otherwise it usually doesn't find the image). I would like to easily adjust these pauses in one place instead of (rather laboriously) going through and adjusting every pause manually. Is there a way I can set a variable to a number (say .7 as a default) and then use that variable as the value in the pause field so I can easily just adjust that one variable and it will adjust the all the pauses using it as a value?

Thanks!

1 Like

Hey JTI,

Welcome to the forum! :smile:

Simple enough once you know how..

-Chris


Pause Using a Variable Duration.kmmacros (5.9 KB)

2 Likes

I use variables to pause quite a bit, in the manner Chris showed you above. It makes it easy for me to test things when timing is an issue.

But there is another possible solution that might work in some cases other than inserting a manual pause in various places. That is, you can get KM to pause a certain amount between EVERY action in a macro. That's probably not what you want but I want you to be aware of this option:

Remember to set the option above to "between actions". The other options are also worth looking at.

3 Likes

Awesome, huge thanks!

I think what happened is I needed to run the macro so that it would actually assign the variable lol!

because where it shows 2->2 before it showed empty->2

Thanks again!

1 Like

Thank you! Something to consider!