Guides
Edit existing files
Open a deck, workbook or template, change what's needed, and keep everything else as it was.
Artiwright works on the files people already have: a deck from last quarter, a finance model, the company template. It reads the whole file, changes only what the agent changes, and writes a new file. The original is never touched.
What’s kept
Section titled “What’s kept”Everything the agent doesn’t change: masters and layouts, the theme, fonts, pictures, SmartArt and other content Artiwright doesn’t edit itself, speaker notes, comments, charts and their data, and in workbooks every sheet, formula, style and setting. An unchanged file saves back byte for byte.
Open a file
Section titled “Open a file”Give the agent the file’s full path, or attach it if your app passes attachments to tools:
Open /Users/you/Documents/q3.pptx, fix the typo on slide 4, and add a slide with the hiring plan.
Add ADK’s SaveFilesAsArtifactsPlugin to your runner. Files your users upload become artifacts, and the document
agent opens them by file name.
The server doesn’t read paths on a client’s behalf. Send the file’s contents (base64) as content to
artiwright_open.
import { Presentation, Workbook } from "artiwright";
const deck = await Presentation.open("q3.pptx");const book = await Workbook.open("plan.xlsx");Start from a template
Section titled “Start from a template”With template: true (or Presentation.fromTemplate in code), a deck starts without the template’s sample slides,
but keeps its theme, masters and layouts. New slides use the template’s own layouts, by key ("title-and-content") or
by the name PowerPoint shows.
Edit safely
Section titled “Edit safely”- Look first.
artiwright_inspectlists every slide, shape and text box with its anchor, so the agent changes the right thing. - Lint knows what was already there. Findings on objects unchanged from the original are reported, but don’t block
finalize unless you ask (
lint.blockPreexisting). Text that runs a little below an invisible box into empty slide, as other tools often write it, isn’t reported: PowerPoint shows it the same as a taller box. - Undo is one step per change.
artiwright_undosteps back through the agent’s edits.