• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Check a text/paragraph is outlined or not using javascript

Participant ,
Jun 02, 2020 Jun 02, 2020

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

1.1K

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
community guidelines

correct answers 1 Correct answer

Participant , Jun 23, 2020 Jun 23, 2020

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

Votes

Translate

Translate
Community Expert ,
Jun 02, 2020 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".)

Votes

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
community guidelines
Participant ,
Jun 03, 2020 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);
}
}
}

Votes

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
community guidelines
Community Expert ,
Jun 05, 2020 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 )

Votes

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
community guidelines
Participant ,
Jun 08, 2020 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.

Votes

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
community guidelines
Community Expert ,
Jun 08, 2020 Jun 08, 2020

Copy link to clipboard

Copied

Hi balajiincse,

my opinion did not change:

You simply cannot know.

 

Regards,
Uwe Laubender

( ACP )

Votes

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

Votes

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
community guidelines
Participant ,
Jun 22, 2020 Jun 22, 2020

Copy link to clipboard

Copied

No, I'm still trying

Votes

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
community guidelines
Participant ,
Jun 23, 2020 Jun 23, 2020

Copy link to clipboard

Copied

LATEST

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

Votes

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
community guidelines