Add counter to files based on creation date from Finder

Hey Chris,

%Local__FilePath% is a PATH. You can't name a file with a path string.

You can't use bare variable names in text fields, such as the file path in the get file attribute action. You have to turn it into a text-token:

%Variable%Local__FilePath%

You're using this notation to represent variables in text-fields elsewhere: %Local__FilePath%.

This is a bad idea, and in my opinion should not be a legal format in Keyboard Maestro – because it's the same as text-tokens. You can't tell the difference at a glance, and that can make debugging much more difficult.

My advice is to always use the “proper” variable form:

%Variable%Local__FilePath%

The Finder-Selection plays little games according to what the sort is in the front window – as @tiffle's post indicates.

If you want to do the whole job yourself you'll have to get the file-creation-date, associate it with the file-path, and sort. Something like this:

Rename Selected Files by Creation Date Order v1.00.kmmacros (7.9 KB)
Keyboard Maestro Export

From there you can find/replace the creation-date to remove it and then iterate through the list of paths which are now in the correct sort order.

I'll leave that as an exercise for the user.

As usual There's More Than One Way to Do It.

-Chris