Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save confluencepoint/727c5d3406e9c20838139c52ba30c5c7 to your computer and use it in GitHub Desktop.
Save confluencepoint/727c5d3406e9c20838139c52ba30c5c7 to your computer and use it in GitHub Desktop.
An Acorn (macOS) script to add a drop shadow to screenshots of shadow-less windows
-- This script uses Acorn (tested with version 6.6.4)
-- to add a light border around a window screenshot.
--
-- Screenshots (without the huge macOS shadows) are made by shift-cmd-4, then space bar,
-- then option-click on window (see https://apple.stackexchange.com/a/120017/17533)
--
-- Before use, you need to create a Preset Filter for this, once:
-- With an image opened, use from menu: Filter / Stylize / Drop Shadow…
-- Set its options as you prefer (e.g. X/Y offset 0, Blur Radius 2, Opacity 80%),
-- then save it by clicking the gear icon, choose "Save Filter Preset…" and
-- name it: Frame Window Screenshot
--
-- To use, open the screenshot in Acorn, then run this script.
--
-- Written 16Apr21 by Thomas Tempelmann, http://apps.tempel.org
tell application "Acorn"
set theDoc to front document
-- increase img size by 2 pixel on each side
set newWidth to (width of theDoc) + 4
set newHeight to (height of theDoc) + 4
resize canvas theDoc width newWidth height newHeight anchor position middle center
-- add a (centered) shadow on all sides
load filter preset theDoc name "Frame Window Screenshot"
do filter theDoc name "Frame Window Screenshot"
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment