Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: Script Label insert into FileName

$
0
0

If the problem is getting the text contents of your labeled box, try something like this:

 

 

var docsizeBoxes = new Array;

for (var i = 0; i < app.activeWindow.activePage.textFrames.length; i++) {

    if (app.activeWindow.activePage.textFrames[i].label == "DOC_SIZE") {

        docsizeBoxes.push(app.activeWindow.activePage.textFrames[i]);

        break; }

}

var docsizeString = app.activeWindow.activePage.textFrames[i].contents;

 

You should now be able to use docsizeString in parsing out the name of the output file.  This assumes that there will be one and only one text frame labeled "DOC_SIZE" on the active page. So you might need some error checking.

 

If it were me, though, I'd just get the actual pageWidth and pageHeight from documentPreferences and use them. In my place, we don't have too many doc sizes to choose from.


Viewing all articles
Browse latest Browse all 37788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>