Variable tokens used to drive logic and renaming


Hi there-
I’ve been poking around Retrobatch, and it looks pretty cool. I’m currently using a lot of custom Photoshop scripts in conjunction with an app called Hazel for my image automation.

Hazel has a great ability to create variables (or what it calls tokens) from matched patterns in a file name. It can then pass those tokens to other rules, or to Applescripts.

It would be great if Retrobatch had a similar feature allowing the user to define a variable for later use in file naming or sorting or to perform other tasks further down the node graph. The current Sort>Rules>Filename>Matches doesn’t seem to provide an ability to create or use these tokens, and the documentation doesn’t really explain what “matches” is doing, or the input it is looking for.

From the documentation:
File Name: Option for separating images based on whether the file name contains, matches, is like, begins with, ends with, is, is not…compared to the manually entered text.

This could also save the user from needing to explicitly define what Retrobatch should do in each case. For example: if my files are named with a pattern Image_Counter_Angle.jpg And I want Retrobatch to always save files to a folder based off the angle identifier, but that angle id has 12 possibilities I would not need to create 12 different rules for each case, but with the reuse of tokens I would only need to create one rule that can create a destination folder based off of the angle ID token.

This is getting a bit verbose, but I hope you get the idea. I’m really excited to see how Retrobatch takes shape, and glad someone recognizes a need for tools like this.


Hello @mkeyes,

The matches option in Rules is a regular expression, we’ll get the documentation updated to reflect that.

I think I understand what you’re after- let me know if this is wrong or not. You want to pull out a part of the filename using a regular expression, and then use that as a token to make a new folder for you?

Do you have a screenshot or something you can point to me on how Hazel does it? I can think of a couple of ways to implement it, but I’d love to see some prior art first.


What about returned data from, say, MobileNet classifications (or any other API integrations that might exist in the future)? It would be awesome to be able to store those into variables for use in output folder/file naming…


I imagine metadata info such as the info returned from classifications could be incorporated somehow.


This is what I am looking for, my main thought is to have the top classifications from the Classify Images step be applied as Keyword metadata to images, or to the XMP sidecar file (if Retrobatch supports editing of that). Is this something that could be done? Data saved to a variable or passed on to the next step to be used dynamically?



It’s not something that’s going to happen with 1.0, but I can see about after that.


That would be amazing!

Congrats on the 1.0 launch!


I’m definitely very interested in Retrobatch. I concur with those who have asked for variables, even if we have to wait for a 2.0 release. For example, if I have a batch of images around which I want to put a border, I really want the thickness of the border to be a percentage of the total image width (smaller image, thinner border). Being able to put the image width or height into a variable would be very useful.


This is something I’m considering as well. With our other app (Acorn) you can do math in most fields - I’d like to do the same with Retrobatch, but with placeholder tokens and such. $ImageWidth$ * .25 , etc.