napkin-sketchdocs 1.0.0 GitHub

Automate#

Generating a script#

Automate > Generate Script writes napkin script for you and shows it before anything uses it. It has three sources:

The Generated script dialog shows the whole script in a box you can scroll and select, with a line that counts its instructions, marks and layers, and a note for anything the language cannot say as the drawing does: pen pressure, for one, is written even. A clipping mask is written as a clip block, which clips with the last closed shape it draws, or, when its clip mark is not that shape or the group has an opacity of its own, as a plain group, with a note. An older file's eraser mark is written as tool eraser, which a script reads as the cut it paints: run, the script draws the marks cut, and no eraser mark. A picture's data is shortened in the box, and everything else takes all of it. Copy puts the script on the clipboard, Save As writes a .napkin file, Open as New Page runs the script into a page of its own after the one in view - the honest way to see what it draws - and Cancel or Escape closes the dialog. Every script starts with a comment saying what it was written from, and the notes follow as comments, so a saved script carries both, and napkin-sketch draw runs it like any other (see Drawing from a script).

Tracking history#

Automate > Track History records the drawing's history as you work: every step you could undo - a stroke, a command, a change in the Layers panel - and every undo and redo, each with what it changed. It is off until you turn it on, and the row shows a check mark while it is on. A step is named for what made it: the command that ran ("Rotate"), the tool whose press on the canvas made it ("Brush stroke"), or, when nothing named it, what it changed ("Changed 2 marks"). A drag is one step, as it is one undo. Only the document is recorded: zoom, pan, the panels, the tool in hand and the colour are not, except as the marks they paint. The steps are what Generate Script > From Session History writes from, and that row is greyed while nothing is recorded.

Automate > History Limit opens Verbose Settings at its Automate section, which holds the same Track History switch and the limit: how many steps are kept, from 50 to 5,000 in steps of 50, and 500 unless you change it. Past the limit the oldest step goes first. Under the limit the section says how many steps there are and roughly how much memory they hold. The steps last as long as the document is open: a new or opened document starts a new history, and turning Track History off clears it, since a step recorded later could change a mark drawn while nothing was recording.