Automator: Take screenshot > Prompt rename > Add date and time to name

applescriptautomatorfinderscreen capture

This is what I need to achieve:

  1. I take a screenshot
  2. Automator watches my Screenshot folder for a new file
  3. A prompt appears for me to rename the file
  4. Date & Time are added after the name I give it

So the result would be: NewName on 02/04/20 at 3:49:44 PM.png

How could I set this up?

I've managed to set up a folder action through automator so that it watched my Screenshots folder, prompts me to rename new files, and add the date/time, but I don't like the time format Automator uses.

Is there a combination of folder action/script that would provide the result shown above?

Thank you!

Best Answer

Renaming and moving files with other actions in Automator usually involves saving the list of file items to restore later, then adding the other actions using the Ignore Input option as needed to keep from mixing up the various results.

If you are using a destination folder for the final result, you can use a workflow something like:

  1. Folder Action receives files and folders added to { targetFolder }
  2. Move Finder Items { To: destinationFolder } (to keep from triggering the folder action again)
  3. Set Value of Variable { Variable: fileItems }
  4. Ask For Text (Ignore Input) (This will be text for the new name)
  5. Set Value of Variable { Variable: newName }
  6. Get Value of Variable { Variable: fileItems } (Ignore Input)
  7. Rename Finder Items { Replace Text, Find: (the text "Screen Shot") in basename only, Replace: (drag newName variable) }