-
Notifications
You must be signed in to change notification settings - Fork 30
GeometricBounds and Coordinates
Luke Schoen edited this page Jan 16, 2015
·
3 revisions
The property geometricBounds
always expects an array of 4 numbers. This represents the points of the upper left corner and the lower right corner, measured from the upper and the left edge of the page in basic setting. This can be changed in the app.documents.item(0).viewPreferences.rulerOrigin
property.
Important the y coordinate is defined before the x coordinate.
var y1 = 0; // upper left Y-Coordinate
var x1 = 0; // upper left X-Coordinate
var y2 = 10; // lower right Y-Coordinate
var x2 = 10; // lower right X-Coordinate
var geometricBounds = [ y1 , x1 , y2 , x2 ]
You can apply this within the script like this
var doc;
// if there is no doc create one
// if there is one - use it
if(app.documents.length < 1){
doc = app.documents.add();
}else{
doc = app.activeDocument;
}
var rect = doc.pages.item(0).rectangles.add();
var y1 = 10;
var x1 = 10;
var y2 = y1 + 100;
var x2 = x1 + 100;
var gb = [y1, x1, y2, x2];
rect.geometricBounds = gb;
This wiki is maintained by:
fabiantheblind
Thanks to:
- JohnDarnell for fixing lots of typos.
- jsp for fixing lots of typos.
- ltfschoen for fixing typos.
- wridgers for adding more links.
Thanks to the students from the seminar for asking all those questions and making me start this wiki.
- adinaradke
- AnitaMei
- ce0311
- coerv
- felixharle
- FerdinandP
- Flave
- marche
- monkian
- natael
- OliverMatelowski
- PDXIII
- praktischend
- schlompf
- skaim
You are awesome.
- Arrays
- Classes
- Comments
- Conditionals
- Functions
- Inspect Properties
- Loops
- Objects
- Output And Interaction
- Recursive Functions
- Inspect Properties
- Variables And Operations
- Extended JavaScript Guide
- Bridge Talk
- Create And Read Files
- ExtendScript Toolkit
- File
- Folder
- Includes JSX
- Object Watch
- Read In JSON From File And DONT Eval
- Storing Data In A Target Engine
- Target an application
- XML
- app
- Colorbrewer
- Colors And Swatches
- Delay And View
- Dialogs
- Documents
- Duplicate And Transform
- Event AfterSave
- Export IDML
- ExtendScript in InDesign Scripting DOM
- Fonts
- GeometricBounds and Coordinates
- Get named pageItems
- Graphic Lines
- Groups
- HSL Color Wheel
- Images
- Includes
- InsertionPoints
- Layers
- Line Feeds And Carrige Returns
- Masterspreads
- Matrix
- Objectstyles
- Outlines Groups Alignment
- Pages And Margins
- Pathfinder
- Placeholder Text
- Rectangles Ovals Polygons
- RulerOrigin
- Select words at insertionPoint
- Simple Find And Change Grep with FC Query
- Simple Find And Change Grep
- Simple Find And Change Text
- Spiro
- Styles
- Text Analysis ID FC
- Text Analysis
- Text Find Locations
- Text
- Transformation Matricies
- TransparencySettings
- XML creation and import