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

Find Text by Formatting and convert to outline

Explorer ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Hi! I need a script which find the text by formatting and convert to outline. If any one know who can make this script please provide.

Thanks

I need the script for specific formatting only for once. So I not need any fancy options or dialog boxes. I also made the character style for the formatting.

TOPICS
Scripting

Views

805

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 2 Correct answers

Enthusiast , Jul 23, 2014 Jul 23, 2014

Try this.

var doc = app.activeDocument;

app.findTextPreferences = null;

app.findTextPreferences.appliedCharacterStyle = "charstylename";

var found = doc.findText();

for(var i =0;i<found.length;i++)

{

        found.createOutlines();

    }

app.findTextPreferences = null;

Regards,

Chinna

Votes

Translate

Translate
Advisor , Oct 26, 2022 Oct 26, 2022

Hello @Rogerio5C09,

 

Some of the script's formatting was lost when ported over from the old site.

I also posted the corrected code under your new post here:

https://community.adobe.com/t5/indesign-discussions/old-topic-find-text-by-formatting-and-convert-to-outline/td-p/13298371

 

var doc = app.activeDocument;


app.findTextPreferences = null;


app.findTextPreferences.appliedCharacterStyle = "Pink Text";


var found = doc.findText();


for(var i =0;i<found.length;i++)


{


        found[i].createOu
...

Votes

Translate

Translate
Enthusiast ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Try this.

var doc = app.activeDocument;

app.findTextPreferences = null;

app.findTextPreferences.appliedCharacterStyle = "charstylename";

var found = doc.findText();

for(var i =0;i<found.length;i++)

{

        found.createOutlines();

    }

app.findTextPreferences = null;

Regards,

Chinna

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
Explorer ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

It;s not finding the characterstyle kindly see the screenshot for error Screenshot (5).png

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
Enthusiast ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Check spelling of the character style name in the indesign, it is a case sensitive so the character style should be Word.

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
Explorer ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

I try this on new document there it is working well. But for this document its keep giving error. Here is the link of the file G.indd - Send Files Online - TempSend.com In this file I need to convert phonetic symbols into outlines. I also try on other styles but It didn't work.

Regards

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
Enthusiast ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

I have only cs6 so send idml file not indd.

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
Explorer ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

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
Enthusiast ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

The reason for not working is the characters style Word is in the gruop "Done".

I just modified the code. Try now.

var doc = app.activeDocument;

app.findTextPreferences = null;

app.findTextPreferences.appliedCharacterStyle = doc.characterStyleGroups.item("Done").characterStyles.item("Word")

var found = doc.findText();

for(var i =0;i<found.length;i++)

{

        found.createOutlines();

    }

app.findTextPreferences = null;

Regards,

Chinna

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
Explorer ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

what it works for you? For me it's not working. Surprisingly In my debugging i try on several other documents and I found that if the character style is alone in paragraph then it works good however the character style in paragraphs the it 'll give error.

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
Enthusiast ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

It is working fine here, I tried with your document only. Try again.

If the character style is in group ("Done") then

app.findTextPreferences.appliedCharacterStyle = doc.characterStyleGroups.item("Done").characterStyles.item("Word")


else it should be

app.findTextPreferences.appliedCharacterStyle = doc.characterStyles.item("Word");

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
Explorer ,
Jul 23, 2014 Jul 23, 2014

Copy link to clipboard

Copied

Thanks It works well. Yeah you was right it was the issue of the grouping.

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 ,
Oct 26, 2022 Oct 26, 2022

Copy link to clipboard

Copied

Hi Chinna,

I know this is a very old topic, but this script is exactly what need! 🙂 Does it work with InDesign 2022 as well? I'm getting a "found.createOutlines is not a function" message when I try to run it on JavaScript.

Rogerio5C09_0-1666797050470.png

Thanks in advance for checking.
Rogerio

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
Advisor ,
Oct 26, 2022 Oct 26, 2022

Copy link to clipboard

Copied

Hello @Rogerio5C09,

 

Some of the script's formatting was lost when ported over from the old site.

I also posted the corrected code under your new post here:

https://community.adobe.com/t5/indesign-discussions/old-topic-find-text-by-formatting-and-convert-to...

 

var doc = app.activeDocument;


app.findTextPreferences = null;


app.findTextPreferences.appliedCharacterStyle = "Pink Text";


var found = doc.findText();


for(var i =0;i<found.length;i++)


{


        found[i].createOutlines();


    }


app.findTextPreferences = null;

Regards,

Mike

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 ,
Oct 26, 2022 Oct 26, 2022

Copy link to clipboard

Copied

LATEST

Thanks again, Mike! 🙂

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