Finding the right variable for "All" text.


so far, i'm copy/paste javascripter , 1 script has troubled me. these following formatting techniques wanted automate adjust copy in documents, , has worked until tried on document contains "paragraph styles".

 

how can refer text (regardless of paragraph & character styles) in document, rather using  variable "allparagraphstyles". i'd also, incorporate change text frame direct selection otherwise highlighted copy, else / document wide.

 

any appreciated!

 

var mydoc = app.activedocument;

myparagraphs = mydoc.allparagraphstyles;

for(var i=1; i<myparagraphs.length; i++)

{

        myparagraphs[i].maximumwordspacing = 151;

        myparagraphs[i].desiredwordspacing = 150;

        myparagraphs[i].minimumwordspacing =  120;

        myparagraphs[i].maximumletterspacing = 500;

        myparagraphs[i].desiredletterspacing = 0;

        myparagraphs[i].minimumletterspacing = 0;

        myparagraphs[i].maximumglyphscaling = 130;

        myparagraphs[i].desiredglyphscaling = 130;

        myparagraphs[i].minimumglyphscaling = 50;

        myparagraphs[i].tracking=0;

        myparagraphs[i].horizontalscale = 75;

        myparagraphs[i].hyphenation = false;

        myparagraphs[i].composer="adobe single-line composer";

        myparagraphs[i].nobreak = true;    

}

just copy , paste this

 

mytexts = app.activedocument.stories.everyitem().texts[0]; // change selection line change to:      mytexts = app.selection[0];  mytexts.maximumwordspacing = 151; mytexts.desiredwordspacing = 150; mytexts.minimumwordspacing =120; mytexts.maximumletterspacing = 500; mytexts.desiredletterspacing = 0; mytexts.minimumletterspacing = 0; mytexts.maximumglyphscaling = 130; mytexts.desiredglyphscaling = 130; mytexts.minimumglyphscaling = 50;  mytexts.tracking=0; mytexts.horizontalscale = 75; mytexts.hyphenation = false; mytexts.composer="adobe single-line composer"; mytexts.nobreak = true;   


More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account