Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Script to delete alternate layout

$
0
0

I am writing a script that puts ID documents into the correct folder and naming structure to be batch imported into a folio. The documents have two alternate layouts, the original "Print" layout and an "I" layout for ipad. I want the script to delete the "Print" layout pages before processing the document. This is effectively the first section of the document. If I try to target it as below, I receive an error that says cannot delete the doc's default section.

 

 

var allSections = myDoc.sections;   var numSections = allSections.length;      if (numSections > 1){       allSections[0].remove();       }

 

How do I correctly target this section, and what is the correct syntax for targeting it by it's altenate layout name, "Print"

 

Many thanks,

Tim


Viewing all articles
Browse latest Browse all 15932

Trending Articles