How to Capture a Web Page Screenshot with Apple Shortcuts on Mac
Apple Shortcuts can run JavaScript on a Safari page, but its documented action does not capture screenshots. Here are the right Mac options.
Short answer: Apple Shortcuts can run JavaScript on an active Safari webpage, but Apple documents that action for retrieving webpage data or modifying page content—not for capturing a screenshot. To capture what is visible, use the built-in macOS Screenshot controls. To save an entire page for later rather than create an image, use Safari’s Web Archive format. These outputs serve different needs.
1. Choose the output you need
| Your goal | Use | What you get |
|---|---|---|
| Capture the visible screen, a window, or a selected area | macOS Screenshot | An image of the displayed screen area |
| Save webpage content, graphics, and links together | Safari File > Save As > Web Archive | An archive file, not a screenshot |
| Save the page’s HTML | Safari File > Save As > Page Source | HTML source, not a rendered image |
| Extract page data or change its appearance | Shortcuts’ Run JavaScript on Webpage action | Data or a modified page, not a documented screenshot |
Apple documents macOS Screenshot as capturing the entire screen, a window, or a portion of the screen. It does not describe those controls as stitching a long, scrollable webpage into one image. If you specifically need a single full-page image, that is a different requirement from capturing the visible Safari window. Apple’s Mac screenshot guide and Shortcuts’ JavaScript action guide explain these separate workflows.
2. Capture Safari with the Mac screenshot controls
- Open the webpage in Safari and arrange the window and page at the position you want to capture.
- Press Shift + Command + 5 to open the Screenshot controls.
- Choose a capture mode: entire screen, selected window, or selected portion.
- For a selected portion, drag the frame around the webpage area. For a window, select the window capture control and click Safari’s window.
- Open Options if you want to change the save location, set a timer, or change other available capture settings. Click Capture.
- Use the thumbnail that appears to mark up, share, or drag the capture into another document. Otherwise, it saves to the selected destination; the default is typically the desktop.
Useful keyboard alternatives
- Shift + Command + 3: capture the entire screen.
- Shift + Command + 4: select an area to capture.
- For a window or menu, press Shift + Command + 4, then press Space and click the open window or menu. Hold Option while clicking to exclude the window shadow.
The entire-screen shortcut captures the whole display, which can include content outside Safari. A window or selected-area capture is usually a better fit when the image should show only the browser page. Available controls and formats can vary by Mac and macOS version. Apple notes that some apps may prevent their windows from being captured.
3. Save a whole webpage in Safari
If your goal is to keep a page’s content for reference and an image is not required, Safari offers two save formats:
- In Safari, choose File > Save As.
- Choose Web Archive to save the page with its graphics. Links can continue to work while their destination pages remain available.
- Choose Page Source if you specifically need the HTML source. It does not preserve a rendered screenshot.
- Choose a location and save.
Safari may be unable to save some items displayed on a page. See Apple’s instructions for saving part or all of a webpage in Safari. A Web Archive is useful for preservation, but it is not an image file and may not reproduce every live or interactive element as a screenshot would.
4. Use Shortcuts with Safari for page data or changes
The action named Run JavaScript on Active Safari Tab (also described as Run JavaScript on Webpage in Apple’s guide) runs a script against an active Safari page. It is intended for tasks such as retrieving selected data or changing page content. Apple does not document it as a way to capture a rendered screenshot.
Set up the action
- In macOS, open Shortcuts and create a new shortcut.
- Add the Run JavaScript on Active Safari Tab action.
- If prompted, allow scripts in Shortcuts’ advanced settings. Apple warns that a webpage script can access information on that webpage, so use shortcuts and scripts you trust.
- Run the shortcut from Safari with the target page active. The action needs an active Safari webpage as input.
Runnable example: return the page title and address
Paste this into the action’s JavaScript field. It returns basic page metadata to the shortcut; it does not take a screenshot.
completion({
title: document.title,
url: location.href
});
When a script returns data, call completion() with the result. Apple notes that the JavaScript action has a time limit, so keep scripts focused. See Apple’s action instructions and introduction to running JavaScript on a webpage.
5. Or skip the browser setup
For a rendered webpage screenshot from code, ScreenshotNeo is a website screenshot API and MCP server. One GET request returns an image or PDF. Its clean-shot flow accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses report the page verdict and billing status in headers. Its MCP server includes take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients.
For complete parameters and response details, see the ScreenshotNeo API documentation.
cURL
curl -G "https://api.screenshotneo.com/v1/shot" \
-d access_key=YOUR_API_KEY \
--data-urlencode url=https://stripe.com \
-o shot.webp
Python
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
timeout=90,
)
r.raise_for_status()
with open("shot.webp", "wb") as image:
image.write(r.content)
Node.js
const q = new URLSearchParams({
access_key: 'YOUR_API_KEY',
url: 'https://stripe.com'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
const image = Buffer.from(await res.arrayBuffer());
await (await import('node:fs/promises')).writeFile('shot.webp', image);
Replace YOUR_API_KEY with your account key and change the target URL. The API supports PNG, JPEG, WebP, or PDF output and options for viewport and device presets, full-page capture, element selection, wait conditions, custom CSS or JavaScript, cookies, headers, caching, and more. Every feature is available on every plan. Plans are Free for 1,000 shots a month with no card; Starter is $5 for 3,000, Growth $15 for 15,000, Pro $39 for 60,000, Scale $99 for 250,000, and Business $249 for 1,000,000. Yearly billing gives two months free.
Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed; an MCP server lets AI agents take screenshots; and 1,000 screenshots a month are free with no card, with paid plans starting at $5 for 3,000. Create a free ScreenshotNeo account.
6. Troubleshooting
| Problem | Likely cause | What to do |
|---|---|---|
| The screenshot includes desktop or other windows | You captured the entire screen. | Use window or selected-area capture from Shift-Command-5. |
| The capture cuts off the bottom of the page | Screenshot controls capture displayed screen content, not a documented scrolling-page image. | Scroll and capture multiple sections, save a Web Archive for preservation, or use a webpage capture workflow designed for full-page images. |
| Shortcuts cannot run the JavaScript action | Script permission may be disabled, or the shortcut was not run with an active Safari webpage. | Enable Allow Running Scripts in Shortcuts’ advanced settings and run the shortcut from Safari on the page. |
| The shortcut returns nothing or fails | The script may not call the completion handler, may run too long, or may contain a syntax error. | Call completion(value), keep the code small, and correct syntax errors. The action has a time limit. |
| A Safari window or page item is missing from the capture or archive | Some apps can prevent window capture, and Safari may be unable to save certain page items. | Try a selected-area capture or another save format; some content may remain unavailable through these built-in methods. |
| The saved file is not an image | Web Archive and Page Source are preservation/source formats. | Use macOS Screenshot for an image capture. |
7. Practical notes on quality and repeatability
- Frame the page first: close unrelated windows, set Safari to the desired size, and scroll to the relevant content before capturing.
- Use a consistent save destination: Screenshot Options let you select where new captures are saved. This helps when a Shortcut or later workflow expects a known file location.
- Handle long pages deliberately: multiple screen captures are a manual set of visible slices; they do not automatically become one continuous image. A Web Archive preserves a different kind of artifact.
- For repeatable automated captures: Shortcuts’ JavaScript action operates in the active Safari webpage and is subject to its time limit. A screenshot API is more appropriate when you need a server-side image workflow, batches, or programmatic output.
- Costs: macOS screenshot controls, Safari Web Archive, and Shortcuts are built-in workflows. ScreenshotNeo has a free allowance and paid tiers; check its documentation for the particular output and options you need.
8. FAQ
Can Apple Shortcuts make a full-page Safari screenshot on Mac?
Apple’s documented Run JavaScript on Webpage action is for retrieving data or modifying webpage content, and its Mac screenshot documentation describes screen, window, and selected-area capture. Neither source documents a Shortcut that creates one stitched image of a whole scrolling webpage.
Is a Web Archive the same as a webpage screenshot?
No. A Web Archive saves webpage material for later viewing; it is not a PNG, JPEG, or WebP image.
Can the JavaScript action read page content?
Yes. It can retrieve selected data from the active Safari webpage. Because scripts can access information on that page, only run code you trust.
Where does a Mac screenshot go?
By default it saves to the desktop. Change the destination in Screenshot controls under Options.


