0

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!

5
  • 1
    The naming convention you want is not possible. – user3439894 Apr 2 '20 at 13:57
  • 1
    The problem with the date naming convention, e.g. 02/04/20, as a filename, not a path filename is / is a path delimiter and cannot be used as part of the individual filename. E.g. 02/04/20 represents multiple directories/folders. As to the time naming convention, a file can be created with, e.g., 3:49:44 PM, however it will show as, e.g., 3/49/44 PM in Finder, but 3:49:44 PM in Terminal. This is in part why the default naming convention for screen shots is e.g.: Screen Shot 2020-04-02 at 10.32.40 AM – user3439894 Apr 2 '20 at 14:36
  • 1
    Also note that renaming a file while it is still in the watched folder will trigger the folder action again. – red_menace Apr 2 '20 at 14:37
  • @red_menace Yeah to avoid the double trigger of the folder action I have the screenshots saved "Temp Folder", once I rename then via the prompt they are moved to "Screenshots". So how could I maintain the default Screen Shot 2020-04-02 at 10.32.40 AM format except for replacing the "Screen Shot" part with whatever I enter in the prompt? – Max Apr 2 '20 at 14:44
  • To your comment RE: "So how could I maintain the default Screen Shot 2020-04-02 at 10.32.40 AM format except for replacing the "Screen Shot" part with whatever I enter in the prompt?" -- It would be more helpful if you'd include your existing Automator Watched Folder workflow in your OP. That said, one way is to use a Rename Finder Items action set to Replace Text and set Find: Screen Shot in basename only, and under Options check [√] Show this action when the workflow runs – user3439894 Apr 2 '20 at 15:22
0

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) }
3
  • FWIW All the variable type actions are not necessary if under Options check [√] Show this action when the workflow runs on the Rename Finder Items action. Then the new name can be entered there. – user3439894 Apr 2 '20 at 15:24
  • Also, shouldn't "(the text "Screen Shot") in full name," be "(the text "Screen Shot") in basename only,"? – user3439894 Apr 2 '20 at 15:28
  • Good point - I tested with the full name option, but if there was a folder with that text in the path it wouldn't end well. Edited the answer. – red_menace Apr 2 '20 at 15:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .