Detect Open Scrivener Project
detect_open_projectDetect the Scrivener project currently open in the desktop app, enabling actions on it without needing a file path.
Instructions
Detect which Scrivener project the user currently has open in the desktop Scrivener app, so you can act on it without asking for a path. Use this when the user says "my project", "the project I have open", or gives a command with no project specified. Reads the open window names from the running app and resolves them to .scriv paths on disk; it does not open anything. If exactly one project is open, pass its path to open_project. macOS only right now (returns supported=false elsewhere; fall back to discover_projects). The first use may prompt macOS to allow the client app to control Scrivener.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| searchPath | No | Optional extra directory to resolve project names against, in addition to the default locations. Absolute or ~-relative path. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | Number of resolved open projects. | |
| running | Yes | Whether the Scrivener app appears to be running. | |
| supported | Yes | False on platforms where detection is not implemented (non-macOS). | |
| unresolved | Yes | Open project names that could not be matched to a .scriv folder on disk. | |
| openProjects | Yes | Open projects resolved to a .scriv path. |