Skip to main content
hamdifem
Inspiring
December 19, 2014
Answered

How to with script add rectangle frame tool

  • December 19, 2014
  • 1 reply
  • 2421 views

app.activeDocument.rectangles.add   Rectangle Tool  adding

but I want adding Rectangle Frame Tool  (isn't rectangle tool)

also where, the current, active page How can I add

This topic has been closed for replies.
Correct answer Chinnadk

Try now,

var doc = app.activeDocument;

doc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;

var currentPage = doc.layoutWindows[0].activePage;

currentPage.rectangles.add({geometricBounds:[0,0,100,100], contentType:ContentType.GRAPHIC_TYPE}) //It adds the rectangle on the current page

currentPage.textFrames.add({geometricBounds:[100,0,200,100]})//It adds the textframe on the current page

Regards,

Chinna

1 reply

Chinnadk
Legend
December 19, 2014

Try this,

var doc = app.activeDocument;

var currentPage = doc.layoutWindows[0].activePage;

currentPage.rectangles.add({geometricBounds:[0,0,100,100]}) //It adds the rectangle on the current page

currentPage.textFrames.add({geometricBounds:[100,0,200,100]})//It adds the textframe on the current page

Regards,

Chinna

hamdifem
hamdifemAuthor
Inspiring
December 19, 2014

great but facing pages while on the right page adding to the left page

and I want to add my isn't rectangle tool I want adding Rectangle Frame Tool

Chinnadk
ChinnadkCorrect answer
Legend
December 19, 2014

Try now,

var doc = app.activeDocument;

doc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;

var currentPage = doc.layoutWindows[0].activePage;

currentPage.rectangles.add({geometricBounds:[0,0,100,100], contentType:ContentType.GRAPHIC_TYPE}) //It adds the rectangle on the current page

currentPage.textFrames.add({geometricBounds:[100,0,200,100]})//It adds the textframe on the current page

Regards,

Chinna