Trouble with prepending folder name with creation date

I have successfully found a script that does what I wanted to do on an individual basis I am now trying to use keyboard maestros "For each item in a collection Execute Actions" function to perform the script on each selected folder in Finder. What it is doing is adding the date multiple times depending on how many selections I have made. In other words, if I select two folders and run the script it prepends the name of the folder with two occurrences of the same date. If I select three folders it puts the date in three times and so on and so on. Obviously this is not him what I want. Just need a date in there once.

What am I doing wrong?

Many thanks,
Houston

Add creation date to folder name.kmmacros (3.2 KB)

Hi Houston, I'm not into AppleScript, so I may be wrong, but this looks to me as if you have two loops in eachother: KM is doing the Script for each file in the folder, and the script itself does it again - maybe you should remove the "repeat with" in there?

1 Like

Thank you Waldbaer, you were exactly correct.

2 Likes