すべてのツール

screenshot_capture

画面、ウインドウ、UI · macOS

効果: 書き込み. 状態: 条件付き提供.

「条件付き提供」は、バージョン、プラットフォーム、権限、アカウント、設定に依存する可能性を示し、すべての環境で有効という意味ではありません。

macOS

目的

ディスプレイ、ウィンドウ、領域の 1 フレームを PNG に取得します。{path, resolution (PIXELS), scale_factor, display_id} を返します。scale_factor は実際に取得したディスプレイの backing scale で、list_displays がその display_id に返す値と同一です(両者は同じ関数を使用)。画像座標を ui_click に変換するとき pixels = points x scale_factor です。ディスプレイを特定できなければ推測せず scale_factor_unknown を返します。resolution は常にあるため比率を算出できます。Screen Recording 権限が必要で、なければ空画像ではなく permission_required を明示します。

必須入力

入力名はツールが要求する正確な形式のままです。英語の正規技術定義は下の展開可能なスキーマにあります。

権限と確認

スキーマには明示的な確認パラメータがありません。これは無許可の操作を認めるものではありません。効果を確認し、承認を得てください。

英語の正規技術スキーマmacOS
{
  "properties": {
    "output_path": {
      "description": "Where to write the PNG (default: temp file). Missing parent folders are created.",
      "type": "string"
    },
    "target": {
      "properties": {
        "display_id": {
          "type": "string"
        },
        "kind": {
          "enum": [
            "display",
            "window",
            "region"
          ],
          "type": "string"
        },
        "region": {
          "description": "{x,y,w,h} global points.",
          "type": "object"
        },
        "window_id": {
          "type": "string"
        }
      },
      "required": [
        "kind"
      ],
      "type": "object"
    }
  },
  "required": [
    "target"
  ],
  "type": "object"
}

ドキュメント例

screenshot_capture のドキュメント例です。この例は実行しないでください。表示される引数は架空のデータセットに属します。実際に呼び出す前に実在する識別子を確認し、承認を得てください。

{
  "target": {
    "display_id": "1",
    "kind": "display"
  }
}