It would generally be easier if you select the whole range (so A1…A5) and then you can just Copy, and then Keyboard Maestro can iterate through the lines in the clipboard and perform the replacement.
If the folder is open in the Finder, then you should be able to just use the FinderInsertionLocation token to get the path.
So, something like this (from the selection range in Excel)
- Copy
- Set Variable Index to Calculation 1 format 0000
-
For Each variable Name in Lines In text %SystemClipboard%
- Rename a File "%FinderInsertionLocation%/%Variable%Name%" to "%Variable%Index_%Variable%Name%"
- Set Variable Index to Calculation Index +1 format 0000
Note that any time you are going to do something like this you really need to ensure you have good solid up to date backups. Personally I would also duplicate the target folder as well for extra safety. And I would double check the value of % FinderInsertionLocation% or just use a fixed path.