Paul Henman mac MacOS screenshot naming format has changed

MacOS screenshot naming format has changed

I noticed recently that the naming format of screenshots in Dropbox has changed: the old format was “Screenshot 2020-08-01 08.33.15.png” but now it’s “Screen Shot 2020-08-13 at 6.58.02 AM.png”. Not then end of the world, I know, but annoying because my Screenshots folder is no longer sorted properly.

Remembering there had been an update to Dropbox recently, I assumed that was the cause and contacted @DropboxSupport but they said it’s a macOS problem!? They pointed me at a Dropbox forum discussion which described the same problem I’m seeing, and it pointed to a thread on StackExchange, which is where I found a partial fix:

System Preferences → Language & Region, then click Advanced…, choose the Times tab and for the Medium format click the hour dropdown and switch it from 1-12 to 00-23 and delete the AM/PM element

(I also deleted the trailing space)

OK, so now my screenshots are named “Screen Shot 2020-08-21 at 21.17.19.png” – but they still aren’t sorting correctly because older screenshots don’t have a space in the leading text. While I continued looking for the full solution, I threw together a quick script to fix the format of files in ~/Dropbox/Screenshots – good enough for now.

I had a look at the Apple discussion forum but didn’t see anything similar, so I started a new thread and by the following morning I had a reply:

My com.apple.screencapture.plist located in ~/Library/Preferences contains the following key that changes the Screen Shot text to Screenshot:

<key>name</key>
<string>Screenshot</string>

I don’t know how to remove the at text.

I couldn’t find which service I need to restart so I just rebooted.

Update: there’s a simpler way to do this!
$ defaults write com.apple.screencapture name "Screenshot"
$ killall SystemUIServer

Well, now my screenshots look like “Screenshot 2020-08-22 at 10.18.35.png” – so close!

Latest: I’ve not found a way to remove “at” from the middle of the screenshot’s name so I run a script to sed out that string.

Update #2: I created a Folder Action to run a script when a file is added to the screenshot folder. This is so simple, I don’t know why I didn’t do it sooner!
I came across this (Automate Repetitive Tasks on Your Mac with Folder Actions) and the steps are really simple:

  1. To create this script, open your MacBook’s ‘Applications’ folder and launch the Automator app. Give the ‘New Document’ button a click and select ‘Folder Action,’ followed by ‘Choose.’
  2. This opens the main Automator screen, which is divided neatly into two: on the left is a menu containing all the ‘Actions’ and on the right-hand side is the editor where you’ll build and edit your workflow.
  3. You create a workflow by grabbing items from the ‘Actions’ menu and dropping them into the editor portion of the Automator window.
  4. Start by pointing Automator at the folder you’re ultimately going to attach this workflow to. Open the ‘Folder action receives files….’ dropdown menu and select ‘Other,’ then select the ‘Downloads’ folder (or another folder of your choosing).
    Selected ~/Dropbox/Screenshots
  5. In the ‘Actions’ menu, make sure ‘Library’ is selected, then find the ‘Set Value of Variable’ action.
    At this point their instructions are the stops for renaming files, but I’ve already got a script doing this
    so I picked the “Run Shell Script” action and added my script’s path, ~/bin/rename_screenshot.sh
    Now I can skip ahead to their last step…
  6. And that’s it! Open Automator’s ‘File’ menu, click ‘Save’ and give your Folder Action a descriptive name; I’m going to use ‘Automatically rename file’. Click ‘Save.’

Test it… Take a screenshot and check folder -> yes, it’s renamed it!

In case my super-simplification of the script (“I run a script to sed out that string“) was too vague, here’s the current version:

#!/bin/sh
for SHOT in Screenshot*
do
        if [ -f "$SHOT" ]
        then
                NO_AT="${SHOT// at / }"
                mv -f "$SHOT" "$NO_AT"
        fi
done 

So, in short, my “fix” is in four parts:

  • Preferences change to use 24-hour clock
  • Defaults change to use “Screenshot” rather than “Screen shot”
  • A simple shell script to remove “at” from between the date and time
  • Folder Action to run the script when a file is added to the screenshots folder

I hope that helps!

4 thoughts on “MacOS screenshot naming format has changed”

  1. Damn. Dedication to finding out the truth! I am also interested in finding out removing the “at” in the text. I removed the words “Screen Shot” entirely so that it looks like “2020-09-03 at 12.19.51 PM” which allowed me to view the entire name of the icon. This way, I can sort out my screenshots by date!

  2. Thanks to John Vakoc for his comment:

    Regarding removing the at on screen shot names: I haven’t found how to remove this one word, but to remove the date stamp all together:
    defaults write com.apple.screencapture “include-date” -bool “false”

Comments are closed.

Related Post