Rename it with random number

i have folder in the desktop call "guy keys"
i need please macro that when i enter file to this folder
it will rename it with random number
like if the file is mp4
the new name will be call 3457.mp4
and if the file is mov
the new name will be call

This works for me:

[test] Watch Folder and Rename Added Files with Random Number.kmmacros (4.8 KB)


Because of the random renaming the macro tends to fall into a loop, because a renamed file seems to count as an added file.

I did this to prevent a loop:

  • The folder trigger is set to “ignore partial or changing files”
  • For the renaming action the macro is temporarily disabled

This works fine for me, for up to 15–20 simultaneously added files in the Finder, but I can’t guarantee that it also works on your system, because of differences in execution/copying times.

But if you only add one (or a couple of) files at a time, you shouldn’t have problems.

If the macro falls into a loop (the same file is renamed endlessly) then cancel the macro.

A side effect of this is that the renaming might take some seconds.

1 Like