MacOS Screenshots¶
Screenshots¶
-
Capture the Entire Screen
- Press Command (⌘) + Shift + 3
-
Capture a Specific Window
- Press Command (⌘) + Shift + 4, then press Spacebar.
-
Use the Screenshot Toolbar
- Press Command (⌘) + Shift + 5
Save location for screenshots¶
- Press Command (⌘) + Shift + 5 to open the screenshot toolbar.
- In the toolbar, click Options.
- Under the Save To section, choose Other Location.
- Navigate to your desired folder and click Choose.
Screenshot format¶
Change the default screenshot format¶
Open Terminal app.
Jpg
defaults write com.apple.screencapture type jpg
PNG (default):
defaults write com.apple.screencapture type png
Remove the shadow from screenshots¶
Open Terminal app.
defaults write com.apple.screencapture disable-shadow -bool true
killall SystemUIServer
Reset screenshot settings¶
defaults delete com.apple.screencapture
AppleScript Application¶
-
Create a New Script
- Open the Script Editor.
- Create a new document.
-
Paste the following AppleScript code into the Script Editor
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
on open droppedFiles set targetWidth to 800 -- Target width for resizing (in pixels) repeat with eachFile in droppedFiles -- Get the file path set filePath to POSIX path of eachFile -- Check file extension and process only image files if filePath ends with ".jpg" or filePath ends with ".jpeg" or filePath ends with ".png" then -- Determine the output path (add _resized to the original filename) set outputFilePath to (text 1 through -5 of filePath) & "_resized.jpg" -- Check if output file already exists set fileExists to false try set fileExists to (do shell script "test -e " & quoted form of outputFilePath & " && echo true || echo false") is "true" end try -- If the file exists, ask the user if they want to cancel if fileExists then set cancelChoice to display dialog "File already exists. Do you want to cancel?" buttons {"Cancel"} default button "Cancel" if button returned of cancelChoice is "Cancel" then return -- Skip this file without showing a message end if end if -- Resize the image using ffmpeg do shell script "/opt/homebrew/bin/ffmpeg -i " & quoted form of filePath & " -vf \"scale=800:-1\" -q:v 2 " & quoted form of outputFilePath else display dialog "Only image files (JPG, PNG, etc.) are allowed." buttons {"OK"} default button "OK" end if end repeat -- Display a completion message display dialog "Images resized successfully!" end open
Note
Line28: replace “/opt/homebrew/bin/ffmpeg” with the path to ffmpeg on your pc
% which ffmpeg /opt/homebrew/bin/ffmpeg
-
Save as an Application
- From the Script Editor menu, choose File > Save As.
- When saving, select the following settings:
File Format: Application
Location: Choose where you want to save (e.g., Desktop).
- After saving, this AppleScript will work as an application.
Drug and dorp a jpg or png file
Download resize_w800jpg.zip <- This app will not work on your PC due to a security issue.
Note
If you don’t have ffmpeg, install it.
% brew install ffmpeg
% brew --version
Homebrew 4.0.6