-
Notifications
You must be signed in to change notification settings - Fork 6
The ID Scripting DOM
fabiantheblind edited this page Oct 7, 2012
·
6 revisions
"The ID Scripting DOOOOOOOOOOOOOOOOM"
wuahahahahahahahah! (Lightning aaaaannnnnddd Thunder)
Now lets have a quick look on how to use all the js in InDesign
/*
As in javascript in the ID DOM everything is an object
you can for example add a doc with a textframe on the first page with
*/
var aString = "Hello World!\rHello Dude. How are you?\rFine and you?";
var doc = app.documents.add();
var pg = doc.pages[0];
var d_pref = doc.documentPreferences;
var pw = d_pref.pageWidth;
var ph = d_pref.pageHeight;
var x1 = 13;
var y1 = 13;
var x2 = pw - x1;
var y2 = ph - y1;
var gb = [y1, x1, y2, x2];
var tf = pg.textFrames.add();
tf.geometricBounds = gb;
tf.contents = aString;
for(var i = 0; i < tf.paragraphs.length; i++){
var par = tf.paragraphs[i];
alert(par + "-->" + par.contents);
for(var j = 0; j < par.words.length; j++){
alert(par.words[j].contents);
}
}
This wiki is maintained by:
fabiantheblind
Collaborators:
- How To Install And Run Scripts
- References And Links
- Tools
- First Session
- Comments
- Extended JavaScript Guide
- Variables And Operations
- Conditionals
- Arrays
- Output And Interaction
- Objects
- Classes
- Loops
- Functions
- Recursive Functions
- The ID Scripting DOM
- ExtendScript
- Inspect Properties
- app
- Documents
- Pages And Margins
- Masterspreads
- Layers
- GeometricBounds and Coordinates
- Text
- Line Feeds And Carrige Returns
- Simple Find And Change Grep
- Simple Find And Change Text
- Text Analysis
- Text Analysis ID FC
- Text Find Locations
- InsertionPoints
- Styles
- Objectstyles
- Rectangles Ovals Polygons
- Matrix
- Outlines Groups Alignment
- Graphic Lines
- Spiro
- Colors And Swatches
- HSL Color Wheel
- Pathfinder
- Fonts
- Transformation Matricies
- Duplicate And Transform
- Includes
- Storing Data In A Target Engine
- Create And Read Files
- Read In JSON From File And Eval
- Delay And View
- ScriptUI Resource Strings