Changing layer order in multiple canvases

Hi All,

I had a 2000 page/Canvas PDF import where I needed to overlay all pages with new headers and footers. What I did was create a shared layer with the required formatting and apply it to all canvases. So far so good. Changing the layer order for 2000 pages. Ho. Ho.

I had to use a script to do it. As I’m a new user I cant upload the script, so here it is.

Hope it saves someone some time.

Rich

/{
“type”: “action”,
“targets”: [“omnigraffle”],
“author”: “Richard Hall”,
“identifier”: “com.brightcloudgroup.changelayerorder”,
“version”: “1.0”,
“description”: “Change Layer 0 to Layer 1”,
“label”: “Change Layer Order”,
“shortLabel”: “CLO”,
“paletteLabel”: “CLO”,
“image”: “gearshape”
}
/
(() => {
var action = new PlugIn.Action(function(selection, sender){
// action code
// selection options: canvas, document, graphics, lines, solids, view
var docView = document.windows[0].selection.view
canvases.forEach(function(cnvs){
docView.canvas = cnvs
//(function(lyr){

	 var lyr0 = cnvs.layers[0]
	 var lyr1 = cnvs.layers[1]
	 lyr0.orderBelow(lyr1) 

	 // })
	 console.log(cnvs.name)
	})
});

action.validate = function(selection, sender){
	// validation code
	// selection options: canvas, document, graphics, lines, solids, view
	return true
};

return action;

})();

1 Like

Thank you !