31 Jul

Custom screenshots app on macOS

Recently, a macOS user asked for a recommendation for an app which would take a screen shot and save it in a folder, with a name based on the current time in a particular format – they didn’t like the macOS default naming.

Rather than recommend an app, we showed them how to make their own using Automator. Here’s how to do it:

First, open up Terminal (found in /Applications/Utilities) and type:

pwd

…then return. It should give you a path that looks something like:

/Users/YourUserName/

If you add “Desktop” to the end of that then you have the path to your desktop. So, it should be something like:

/Users/YourUserName/Desktop/

Don’t forget the slash on the end.

Right! That was the hard bit. Next, replace the XXX in my line below with your desktop path:

theDate=$(date "+%Y-%m-%d_%H-%M-%S"); theSaveFolder="XXX"; screencapture -i -o "$theSaveFolder/$theDate.png"

Next, fire up Automator (in your Applications folder). Make a document of type “Application”. Then all you need to drag a “run shell script” action from the side bar into the main panel and replace the default text with the line above.

You should now have something that looks like this (click for a larger view):

Save your work, and you now have a shiny new app which will take screen shots and name them with a timestamp whenever you click it. Of course, you can play around with the time stamp format if you like. There’s a guide to the UNIX date command (which is what we’re using) here https://ss64.com/bash/date.html

For more cool ideas with Automator, why not check out: