File name from finder tags?

OK, so here's a first stab while waiting for clarification.

One possible problem is that tags appear to be held as an unordered list -- while KM will probably return them in same order every time it would be better not to rely on that. Instead, we'll iterate through all the tags, testing them to see what they are and processing as appropriate.

You'll need to either edit any tags with a "," in them to remove that character (it's the delimiter in the returned tag list), or if you've always used ", " you could S'n'R it with a unique string then reverse that later.

One big assumption is the only tag with a "-" is the one you want to ignore -- you may have to change that!

The demo uses a local variable for the file counter so it will start at 20000 every time -- the macro can be updated to use a global if the production version requires the value to persist over different runs. And rather than rename files it will pop a text window for each so that you can compare the file's tags and the proposed name.

You didn't say how you'd select files -- this processes the current Finder selection, so select some files and run the macro to see if the results are anything like what you are after.

Rename from Finder Tags.kmmacros (13.6 KB)

Image

I doubt this'll be exactly what you want but all the actions are pretty simple and it'll be easy enough for you to make changes, so see how you get on.