Rename Screenshot Macro (v11.0.3)

Rename Screenshot Macro (v11.0.3)

Rename Screenshot.kmmacros (2.9 KB)

Hi everybody!

Im absolute beginner in kmmacros and yes 'I've seen that solution Rename Macro for Screenshot - #7 by ccstone
but I'm wondering is it possible to resolve problem in my macro.
When screenshot is taken in standard way (with MacOS shortcut) to selected folder, the macro ask user about new file name and rename the file. Everything is ok to this point but ... after short period there is another macro call, with file with new name ... because file was renamed and MacOs treat them as a new file. :frowning: .
Of course this time user select cancel, but probably if not - the macro will be looping with next new file name.

Does someone have any idea how to bypass this second call of the macro?

Congratulations. Since you have correctly diagnosed this problem which has fooled many people, you're no longer an absolute beginner.

Have you considered fixing it by placing this action before your rename action:

image

And then after the rename action, do this:

image

I didn't test this myself, but it looks like it may work. I'm pretty sure there are alternative solutions, and I expect someone to come up with another one.

2 Likes

Ha!
It seems to work - at least for two screenshots.

Thanks a lot, I didn't notice that I could disable/enable macro (and never even I would think before why such action is needed)!

BTW
I observe a few seconds delay between capture of screen and macro triggering but it is probably system delay.

If it ever fails, you might try putting a short "pause" after your rename action, because sometimes macOS does things asynchronously from KM. KM is fast, and sometimes we need to slow it down to make it work correctly.

You may be right. If you are curious to find out the cause, or to find out if there's a faster way, you can try a different way to take a screenshot. One way is to use the KM "Screen Capture" action instead of the default GUI shortcut, and another way is to use the macOS "screencapture" command. It's possible that one of these two methods could speed up your times.

Another option would be to take the screenshot using KM and name it at the same time.

Screenshot - Name and Save.kmmacros (40 KB)

Macro screenshot

3 Likes

Another option in addition to those above is to capture to a "temporary" watched folder, as you have done, and have the macro rename and move the file to its "proper" destination.

2 Likes