Saving each layer of a canvas as a separated PDF



Is it possible to save each layer of a canvas as a separate PDF? Often times, I draw diagrams that I need to save in different pdf to be included from latex as different subfigures. Is there any automation to help with this task. It would make my life so much easier.



The way I would approach this is to start with all layers hidden, keep an index count and get the total number of layers to iterate through each of them in a loop. You could export the layer name as your document name + layer name to make it easy to match up where the figure came from.

Open file, If the document has 1 canvas, get total layer length (index count), export to PDF, hide layer 1, increment index count.
(loop through process again for each layer in the front document).

If the document has >1 canvas, loop get the total number of canvases, and run the loop for each layer of each canvas.

Using either AppleScript or JavaScript, I’d recommend trying this in our OmniGraffle 7.11 test builds, which have the latest scripting fixes and improvements. Let us know if the scripting improvements are helpful, or if there is something you need to automate that isn’t possible.

If you need more support to get started, please check out for OmniGraffle Automation in JavaScript, and open OmniGraffle in Script Editor for AppleScript and JXA. If you get stuck, posting an example script along with where you are stuck can help us support your scripting efforts.