Skip to main content
hamdifem
Inspiring
December 19, 2014
Répondu

How to with script add rectangle frame tool

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

Ce sujet a été fermé aux réponses.
Meilleure réponse par 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 commentaire

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
hamdifemAuteur
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
ChinnadkRéponse
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