Category filter

Script to change screenshot settings on Mac

macOS, like every other OS, has a default way of dealing with screenshots. These default methods may not always align with the requirement of an organization or an employee’s work.
For example, Macs save their screenshots in PNG format by default, but the organization’s task management software may support only JPG files. Similarly, screenshots get saved to the Desktop by default, while the organization may prefer having screenshots saved in a dedicated folder as a measure to heighten security.
Changing the default screenshot configurations on each device individually to solve these issues isn’t feasible. This is where Hexnode UEM’s Execute Custom Script action comes in handy. IT admins can execute the scripts given below to modify the default screenshot configurations of devices in bulk and remotely.

Scripting Language – Bash

File extension – .sh

Disclaimer:


The sample scripts provided below are adapted from third-party open-source sites.

Script to change the default format of screenshots

Macs save their screenshots as PNG files by default. Execute this script to change the default format of screenshots. Replace “format” with the required format.

For example,

Once this script is executed, the screenshots further captured will be saved as a JPG file. Similarly, the default screenshot format can be changed to PDF, PSD, TIFF or others.

Script to change the default location of screenshots

By default, screenshots get sent to the Desktop. Replace “location” with the location of your choice and execute this script to change the default location of screenshots. It can be saved to Downloads, Documents, Photos or any dedicated folder of your choice.

For example, execute the script given below to change the default location of screenshots to the Downloads folder:

Script to change the default naming of screenshots

By default, screenshots are saved with the name ‘Screenshot [date] at [time].png.’

Script to change the default prefix

Execute the following script to change the “Screenshot” prefix to anything of your choice. Special characters and numbers are supported too.

Replace “name of your choice” with the required prefix.

For example,

Once this script is executed, the screenshots will be saved as ‘ACME [date] at [time].png’

Script to remove date and time from name

Execute the following script to remove the date and time from the screenshot’s name.

Once this script is executed along with the previous one, the screenshots will be saved as ‘ACME.png’.

Notes:

  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository