Import script file
import_scriptImport a Final Draft (.fdx) file, a WriterDuet (.json) file, or Fountain / screenplay-formatted plain text (a pasted script) into the project's script. Pass the full text as content, or the textId extract_file_text returned for a PDF or page images. The format is detected from the content; pass format only to force it ("fountain" forces the plain-text importer). Plain text counts as a screenplay when it has INT./EXT. scene headings or uppercase character cues with dialogue below them. Numbered headings (1. INT., 12 INT. ... 12), SC. n / SCÈNE n / SAHNE n markers and INTERIOR / INTÉRIEUR spelled out are read as scene headings.
A script that already has writing (beyond its title block) is never added to silently: a real call with insertPosition "end" or "start" then needs confirmAppend: true, and the preview's placement.existingScript says what is there. Ask the user first whether the file goes into a new project of its own (create_project, then import there), is added to this script, or replaces it. In the user's copy of the example project (existingScript.exampleProject), recommend a new project.
Call it with dryRun: true first. Nothing is written. The preview lists the scenes, element counts, where the content goes (and whether a Final Draft title page is kept), and for each character and place name in the file the entity it links to or "create", with near-miss candidates (a similar existing name, for example TOBY and TOBIAS). When the preview has near misses, show the user those links and ask; names to create need no question (say in your reply which story elements the import created). Then import for real with entityMap, mapping each confirmed name to its entityId (from the preview or list_entities). Names left out of entityMap are linked by name or created. The preview's warnings flag a file that looks misread: no scene heading in a long file, one scene holding hundreds of elements, or an abnormal number of characters (headings or action taken for cues). Relay every warning to the user before they confirm and never report such an import as a success.
entityMap keys are names as the file writes them; a cue extension is ignored ("MARA (O.S.)" is the key "MARA"). Only characters and places can be mapped. A mapped cue line takes the entity's name and keeps its extension, and a mapped scene heading takes the place's name.
The file is parsed by the app's own importers: scene headings, action, characters, dialogue, parentheticals, transitions and structure keep their types. CHARACTER lines and scene headings are linked to the project's characters and places by name ("MARA (O.S.)" and "MARA (CONT'D)" link to MARA and keep "(O.S.)" / "(CONT'D)" on the cue line), and missing ones are created as story elements (returned in createdEntities). The pre-import script is saved to version History so the user can undo it.
insertPosition: "end" (default) appends after the current script; "start" puts the file first, after the script's title block (its first EPISODE and the OUTLINE lines under it); "replace" replaces the whole script and requires confirmReplace: true on the real call (a dryRun does not), so ask the user before replacing their writing. A Final Draft or Fountain title page becomes the script's title block only on a replace or an empty script; otherwise it is left out.
A PDF, a scan or photos of pages: call extract_file_text first, then import its text here with textId. Never retype a long script with edit_script. For text that is not screenplay-formatted (notes, prose, a treatment), this tool refuses it: ask the user whether to turn it into a script before writing it with edit_script, one element per scene heading, action paragraph, character cue, parenthetical and dialogue line. A Word (.docx), OpenDocument (.odt) or EPUB file is read as text, and a Word screenplay with screenplay paragraph styles or INT./EXT. headings imports directly.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"projectId": "<projectId>"
},
"name": "import_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | Preview only: parse and plan, write nothing, and return the links the import would make. | |
| format | No | Force the importer. Detected from content when omitted. | |
| textId | No | textId from extract_file_text: imports that text instead of content. | |
| content | No | The file's full text: FDX XML, WriterDuet JSON, or Fountain / screenplay-formatted plain text. Pass this or textId. | |
| entityMap | No | Force links: { "<name in the file>": "<entityId of an existing character or place>" }. A cue extension in the key is ignored. | |
| projectId | Yes | ScreenWeaver project id (from list_projects). | |
| confirmAppend | No | Must be true to add the file ("end" or "start") to a script that already has writing, once the user chose that over a new project or a replace (not needed with dryRun). | |
| confirmReplace | No | Must be true when insertPosition is "replace" (not needed with dryRun). | |
| insertPosition | No | Where the imported script goes. Default end. |