Highlighted

Add a Text box the size of the page with stroke to page?

Advocate ,
Jul 09, 2020

Copy link to clipboard

Copied

I looked and am probably wording it incorrectly in my searches. Is there a script that adds a text Frame (the size of the Page) and adds a stroke around it? and if possible can it also have a corner radious?

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

Hi cbishop01,

you could try this with reading out the bounds of a page and use the resulting array for the geometricBounds of an added text frame. The corner radius of a text frame is defined in four pairs of properties. Here an example with the top right corner on page 1:

 

var doc = app.documents[0];
var page = doc.pages[0];

page.textFrames.add
(
	{
		geometricBounds : page.bounds ,
		fillColor : "None" ,
		
		strokeColor : "Black" ,
		strokeWeight : "1Pt" ,
		
		strokeAlignment : StrokeAlignment.INSIDE_ALIGNMENT ,
		
		topRightCornerRadius : "10mm" ,
		topRightCornerOption : CornerOptions.ROUNDED_CORNER
	}
);

 

For all other needed properties see the DOM documentation compiled by Gregor Fellenz:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#about.html

 

There could be complications if the pages are transformed, but for an ordinary document this should work.

 

Regards,
Uwe Laubender

( ACP )

TOPICS
Scripting

Views

60

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Add a Text box the size of the page with stroke to page?

Advocate ,
Jul 09, 2020

Copy link to clipboard

Copied

I looked and am probably wording it incorrectly in my searches. Is there a script that adds a text Frame (the size of the Page) and adds a stroke around it? and if possible can it also have a corner radious?

Adobe Community Professional
Correct answer by Laubender | Adobe Community Professional

Hi cbishop01,

you could try this with reading out the bounds of a page and use the resulting array for the geometricBounds of an added text frame. The corner radius of a text frame is defined in four pairs of properties. Here an example with the top right corner on page 1:

 

var doc = app.documents[0];
var page = doc.pages[0];

page.textFrames.add
(
	{
		geometricBounds : page.bounds ,
		fillColor : "None" ,
		
		strokeColor : "Black" ,
		strokeWeight : "1Pt" ,
		
		strokeAlignment : StrokeAlignment.INSIDE_ALIGNMENT ,
		
		topRightCornerRadius : "10mm" ,
		topRightCornerOption : CornerOptions.ROUNDED_CORNER
	}
);

 

For all other needed properties see the DOM documentation compiled by Gregor Fellenz:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#about.html

 

There could be complications if the pages are transformed, but for an ordinary document this should work.

 

Regards,
Uwe Laubender

( ACP )

TOPICS
Scripting

Views

61

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 09, 2020 0
Adobe Community Professional ,
Jul 09, 2020

Copy link to clipboard

Copied

I don't know if a such script exists (certainly yes) but it is easy to draw a rounded corner frame on the master page and apply this master page on the pages you need. Better place this frame on a separate layer, under the others.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 09, 2020 0
Adobe Community Professional ,
Jul 09, 2020

Copy link to clipboard

Copied

Hi cbishop01,

you could try this with reading out the bounds of a page and use the resulting array for the geometricBounds of an added text frame. The corner radius of a text frame is defined in four pairs of properties. Here an example with the top right corner on page 1:

 

var doc = app.documents[0];
var page = doc.pages[0];

page.textFrames.add
(
	{
		geometricBounds : page.bounds ,
		fillColor : "None" ,
		
		strokeColor : "Black" ,
		strokeWeight : "1Pt" ,
		
		strokeAlignment : StrokeAlignment.INSIDE_ALIGNMENT ,
		
		topRightCornerRadius : "10mm" ,
		topRightCornerOption : CornerOptions.ROUNDED_CORNER
	}
);

 

For all other needed properties see the DOM documentation compiled by Gregor Fellenz:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#about.html

 

There could be complications if the pages are transformed, but for an ordinary document this should work.

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 09, 2020 1