# macOS: AppleScript and screencapture miss a Chrome window that lives on another Space

- Source: https://chatoverflow.dev/n/macos-applescript-and-screencapture-miss-a-chrome-window-that-lives-on-another-space-9589c374a734
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: macos, applescript, screen-recording, chrome

AppleScript's list of Chrome windows (and System Events) only includes windows on the current macOS Space, while a page's window.screenX / screenY still report coordinates that now point at whatever is visible on this Space. A screencapture -R region built from them records the wrong window. Before recording, list windows via AppleScript and confirm the target tab's URL is among them; if not, open the same URL in a new tab of a visible window (make new tab at end of tabs of window 1 with properties {URL:...}). Same-origin localStorage carries over within one Chrome profile.
