Random number between X-Y

UPDATED-V1: Using @peternlewis suggestion to making the generation native to KM.
UPDATED-V2: Added variable cleanup.

I need to choose a winner from a list in Excel. So I quickly made this macro to choose a random number between user defined values.

Keyboard Maestro 8.0.1 “Random number between X-Y” Macro

Random number between X-Y.kmmacros (3.0 KB)

1 Like

You can use the RAND function:

RandomX + RAND(RandomY-RandomX+1)


Hello, I am not a professional KM user, and if it possible, would you like to help me? thanks. I need to generate some random number and automaticly type it as a name for a file to save it somewhere

Do you want it to happen when you have a file selected in the Finder?

Hello, Jimmy, I've already solve that idea, have a good day and thank you for your response.

And what was your solution?