hammerspoon2-docs
    Preparing search index...

    Function snapshotForID

    • Capture the current on-screen contents of the window with the given ID. Requires Screen Recording permission.

      Parameters

      • id: number

        The window's underlying ID (see the id property on hs.window objects).

      • OptionalkeepTransparency: boolean

        Whether to preserve the window's alpha channel. If false (the default), transparent regions are filled with an opaque black background.

      Returns Promise<HSImage>

      Resolves with the captured image, or rejects if no window with that ID can be found, or the capture fails.