Highlighted

Check a text/paragraph is outlined or not using javascript

Community Beginner ,
Jun 02, 2020

Copy link to clipboard

Copied

How to check a text or paragraph is oulined or not using javascript.

hi,

you can find outline, but also find an anchor if outline consists of one character

var cur_obj = app.selection
var list = []
for(var i=0; i<cur_obj[0].characters.length; i++){
	var charcode = 0
	try{charcode = cur_obj[0].characters[i].contents.charCodeAt()}
	catch(e){}
	if(charcode > 65000){
		var iOutline = false
		
		try{
			var path = cur_obj[0].characters[i].pageItems[0].paths.length
			iOutline = true
		}
		catch(e){}

		if(iOutline){
			list.push('\n')
			list.push('type name '+cur_obj[0].characters[i].pageItems[0])
			list.push('path '+path)
		}
	}
}
alert(list)

outline.JPG

Topics

Scripting

Views

851

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

Check a text/paragraph is outlined or not using javascript

Community Beginner ,
Jun 02, 2020

Copy link to clipboard

Copied

How to check a text or paragraph is oulined or not using javascript.

hi,

you can find outline, but also find an anchor if outline consists of one character

var cur_obj = app.selection
var list = []
for(var i=0; i<cur_obj[0].characters.length; i++){
	var charcode = 0
	try{charcode = cur_obj[0].characters[i].contents.charCodeAt()}
	catch(e){}
	if(charcode > 65000){
		var iOutline = false
		
		try{
			var path = cur_obj[0].characters[i].pageItems[0].paths.length
			iOutline = true
		}
		catch(e){}

		if(iOutline){
			list.push('\n')
			list.push('type name '+cur_obj[0].characters[i].pageItems[0])
			list.push('path '+path)
		}
	}
}
alert(list)

outline.JPG

Topics

Scripting

Views

852

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
Most Valuable Participant ,
Jun 02, 2020

Copy link to clipboard

Copied

You mean, "converted to outlines"? You cannot know.

 

If an object does not contain plain text contents, then it may be ... anything. From a simple line, rectangle, or ellipse, to a complicated multi-path object. The latter could have been text but not necessarily so.

(Also, a simple rectangle may have been a sans serif capital "I".)

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...
Community Beginner ,
Jun 03, 2020

Copy link to clipboard

Copied

Hi Jong,

 

I need to find a outline text, that means when we used the edit>create outlines option, the selected will converted into outline in indesign.

So my requirements i need to find the outlined text using javascript, please review my lines and let know any changes.

 

var myDoc = app.activeDocument;
var pageSte = myDoc.allPageItems;
for(var s=0;s<pageSte.length;s++){
var se = pageSte[s].parent.constructor.name;
if(se == "Character"){
try{
var contentLength = pageSte[s].contents.length;
}catch(e){}
if(contentLength == 0){
alert(contentLength);
}
}
}

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...
Adobe Community Professional ,
Jun 05, 2020

Copy link to clipboard

Copied

Hi balajiincse,

as Jongware already noted:

You simply cannot know.

 

If we could assume that only parts of texts in a text frame are converted, then we could  hunt for anchored inline objects with composite paths; eg. polygons with more than one path. Perhaps organized in anchored groups.

 

That would be an indication, but it would never be a proof.

 

FWIW: Why is your response marked as Correct Answer?

The question is still open, I think.

 

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...
Community Beginner ,
Jun 08, 2020

Copy link to clipboard

Copied

Hi Laubender,

 

Yes, I can't find it, so I changed my opinion,

 

Creating a report, with the page has contain ouline text and report the page number, i think that is possible.

 

please share your opinion.

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...
Adobe Community Professional ,
Jun 08, 2020

Copy link to clipboard

Copied

Hi balajiincse,

my opinion did not change:

You simply cannot know.

 

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...
Adobe Employee ,
Jun 13, 2020

Copy link to clipboard

Copied

Hi there, 

 

I hope your issue has been resolved. But if the issue still persists, please let us know so that we can assist you.

 

If any of the above-mentioned solutions have worked for you, kindly mark the answer correct. 

 

Regards,

Sheena

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...
Community Beginner ,
Jun 22, 2020

Copy link to clipboard

Copied

No, I'm still trying

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...
Explorer ,
Jun 23, 2020

Copy link to clipboard

Copied

hi,

you can find outline, but also find an anchor if outline consists of one character

var cur_obj = app.selection
var list = []
for(var i=0; i<cur_obj[0].characters.length; i++){
	var charcode = 0
	try{charcode = cur_obj[0].characters[i].contents.charCodeAt()}
	catch(e){}
	if(charcode > 65000){
		var iOutline = false
		
		try{
			var path = cur_obj[0].characters[i].pageItems[0].paths.length
			iOutline = true
		}
		catch(e){}

		if(iOutline){
			list.push('\n')
			list.push('type name '+cur_obj[0].characters[i].pageItems[0])
			list.push('path '+path)
		}
	}
}
alert(list)

outline.JPG

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...