How to Automatically Save Screenshots to a Folder Using AppleScript

Are you someone who takes a lot of screenshots on your Mac? Do you find it tedious to constantly navigate to the Desktop and drag your screenshots to a folder? If so, you can automate this task using AppleScript!

In this tutorial, you’ll learn how to use AppleScript to save your screenshots to a designated folder on your computer. This will save you time and make your workflow more efficient.

Step 1: Create a New Folder to Save Your Screenshots

The first step is to create a new folder on your computer where you want to save your screenshots. To do this, follow these steps:

  1. Open Finder
  2. Navigate to the location where you want to create the folder
  3. Click on “File” in the menu bar and select “New Folder”
  4. Name the folder something like “Screenshot Folder”

Step 2: Open Script Editor

Now it’s time to open Script Editor, the app that allows you to write, edit, and run AppleScript code. You can find Script Editor in the Utilities folder, which is located in the Applications folder.

Alternatively, you can use Spotlight to search for Script Editor. Simply press Command + Space to open Spotlight, type in “Script Editor” and hit Enter. This will open Script Editor on your Mac.

Step 3: Write the AppleScript Code

Next, you’ll write the AppleScript code to automatically save your screenshots to the folder you created in step 1. Copy and paste the following code into Script Editor:

on adding folder items to this_folder after receiving added_items
    repeat with i from 1 to number of items in added_items
        set this_item to item i of added_items
        tell application "Finder"
            set the item_path to POSIX path of this_item
            set the save_folder to "Macintosh HD:Users:YourUserName:Screenshots"
            set the new_name to (do shell script "date +%Y_%m_%d-%H%M%S")
            set save_path to save_folder & new_name & ".png"
            duplicate this_item to folder save_folder
            set the name of result to new_name & ".png"
        end tell
    end repeat
end adding folder items to

Don’t forget to replace “YourUserName” in the code with your actual username on your Mac. This code essentially tells your Mac to watch the folder where screenshots are saved and then move them to the designated folder.

Step 4: Save the Script

After writing the code, save the script by clicking on “File” in the menu bar and selecting “Save”.

Choose a name for your script that describes what it does (e.g. “Automatically Save Screenshots to Folder”).

Select “Script” as the file format and save it to the “Script” folder in your home directory.

Step 5: Run the Script

To run your script, simply take a screenshot on your Mac. The screenshot will automatically be saved to the folder you created earlier.

That’s it! You’ve successfully automated the task of saving your screenshots to a designated folder on your Mac.

Conclusion

This tutorial showed you how to use AppleScript to automatically save screenshots to a folder on your Mac. While this might seem like a simple task, it can save you a lot of time in the long run. By automating some of your daily tasks, you can work more efficiently and be more productive.

delta

Leave a Reply Text

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.