Hi all! I am quite new with Keyboard Maestro and do my first small steps. Currently I am struggling with a simple renaming of one and/or multiple files. Quite simple, the file name shall be kept, and as a prefix I want to add current date.
In the (fantastic) forum I found this example: Rename File. It's pretty much what I was looking for, so I adopted this for my purposes.
My understanding of this macro is, that it should actually also work for multiple files. But unfortunately, it doesn't work at all.
No need to be embarrassed; this is a fairly new problem you've run into. The issue here is that your for each collection is set to the Finder's selection, but you're using the new dragged file trigger to run the macro. Just set the LocalFile variable to the %TriggerValue% token first and remove the enclosing For Each loop and it should work fine (macros triggered by the dragged file trigger execute a separate instance of the macro for each file dragged onto it, which means For Each isn't needed, and it won't properly list the changed file names in a local variable). An example:
Re-reading this thread, the point of the rename was to prepend the current date to the existing file name. If the file was only moved to LocalFileName, there essentially wouldn't be any change made to the file name at all.