Skip to main content
hamdifem
Inspiring
September 3, 2014
Answered

finding features in InDesign, I want a rectangle known coordinates can move I would be glad if you write for this scprit

  • September 3, 2014
  • 1 reply
  • 278 views

finding features in InDesign, I want a rectangle known coordinates can move

I would be glad if you write for this scprit

This topic has been closed for replies.
Correct answer Sajeev Sridharan

If you want to get coordinates, select a rectangle and try the below code:

var rectangleBounds = app.selection[0].geometricBounds;//array

alert(rectangleBounds[0]);

alert(rectangleBounds[1]);

alert(rectangleBounds[2]);

alert(rectangleBounds[3]);

if you want move rectangle,

app.activeDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points; 

app.activeDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points; 

app.selection[0].move([0,10])//x-axis and y-axis

Vandy

1 reply

Sajeev SridharanCorrect answer
Legend
September 3, 2014

If you want to get coordinates, select a rectangle and try the below code:

var rectangleBounds = app.selection[0].geometricBounds;//array

alert(rectangleBounds[0]);

alert(rectangleBounds[1]);

alert(rectangleBounds[2]);

alert(rectangleBounds[3]);

if you want move rectangle,

app.activeDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points; 

app.activeDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points; 

app.selection[0].move([0,10])//x-axis and y-axis

Vandy

hamdifem
hamdifemAuthor
Inspiring
September 3, 2014

Thank you very much, but

In this script document with facing pages, single pages (3, 5, 7, ...) does

not process

I want to do my

The height and width of a rectangle with known or find text frame, changing

the height and width, to move to a point

I'm glad I sent you edit scprit

*****

var findX, findY, changeX, changeY, moveX, moveY;

var diyalogWindow = app.dialogs.add();

with(diyalogWindow){

with(dialogColumns.add()){

with(borderPanels.add()){

with(dialogColumns.add()) {

staticTexts.add({staticLabel:"FİND X"});

findX = textEditboxes.add();

staticTexts.add();

findY = textEditboxes.add();

}

with(dialogColumns.add()) {

staticTexts.add({staticLabel:"CHANGE X"});

changeX = textEditboxes.add();

staticTexts.add();

changeY = textEditboxes.add();

}

with(dialogColumns.add()) {

staticTexts.add({staticLabel:"MOVE X"});

moveX = textEditboxes.add();

staticTexts.add();

moveY = textEditboxes.add();

}

}

}

}

if(diyalogWindow.show() == 1) {

var myDocument=app.activeDocument;

var p;

for(p=0; p < myDocument.selection.length; ++p) {

myDocument.selection

.move();

// ................... how contined ???

}

}

2014-09-03 15:19 GMT+03:00 vandy88 <forums_noreply@adobe.com>:

finding features in InDesign, I want a rectangle known coordinates

can move I would be glad if you write for this scprit created by vandy88

<https://forums.adobe.com/people/vandy88> in InDesign Scripting - View

the full discussion <https://forums.adobe.com/message/6697059#6697059>