Save a captured browser download to a file
download_fileCapture a Twine game's browser download by clicking its button or choosing an existing file, then copy it to a target path.
Instructions
Browser file control for any game: every download is captured into the tool's download folder (see list_downloads). Three modes: (a) pass trigger_text/trigger_ref/trigger_selector to click the game's download button and take that file; (b) pass name or index to take an already-captured file from the folder; (c) pass none of those to take the newest file in the folder. Without path the file stays in the download folder (path = its location); with path (a file or a directory) a copy is placed there too. Returns the path, size and the new observation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Name of an already-captured file from list_downloads (exact, suffix, or unique substring). | |
| path | No | Destination file or directory (default <cwd>/downloads/<name>). | |
| index | No | 1-based index from list_downloads (newest first). | |
| format | No | Output format: "text" (default, human-readable) or "json" (JSON string for programmatic use). | |
| game_id | Yes | Session id returned by open_game. | |
| timeout_ms | No | How long to wait for the download after clicking (default 30000). | |
| trigger_ref | No | Ref of the download button (alternative to trigger_text). | |
| trigger_text | No | Visible text of the button that starts the download (optional). | |
| trigger_selector | No | CSS selector of the download button (alternative to trigger_text). |