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

How can I text out the group and throw this into the textframe script

Explorer ,
Dec 23, 2016 Dec 23, 2016

Copy link to clipboard

Copied

I want text out the group and throw this into the textframe but I can't. Please, help me. Thanks a lot.

Views

865

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

LEGEND , Dec 24, 2016 Dec 24, 2016

Thanks!

Don't forget it's Christmas soon and some bottles are over yet! … 

… If I understood what you mean, you have this:

Capture d’écran 2016-12-24 à 14.16.33.png

As I saw, you seem to use a "condition"! … and you would like to get this!

Capture d’écran 2016-12-24 à 14.07.21.png

For that, try this [just change the condition name! Here = "Test"]:

app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.ENTIRE_SCRIPT, "Extract Conditional Text! …");

function main()    

    {

        var myDoc = app.activeDocument;

        var myCondition = "Test"; 

        app.findGrepPr

...

Votes

Translate

Translate
Community Expert ,
Dec 23, 2016 Dec 23, 2016

Copy link to clipboard

Copied

You might want to ask in the InDesign Scripting forum:

InDesign Scripting

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
Mentor ,
Dec 23, 2016 Dec 23, 2016

Copy link to clipboard

Copied

You mean: extract text frames from group?

Take a look at this thread, there are good working samples.

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 ,
Dec 23, 2016 Dec 23, 2016

Copy link to clipboard

Copied

Thanks. It works but I don't need that one. I wanna take out groups items not on the pasteboard. It should be on the same page that I have taken.

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 Beginner ,
Dec 24, 2016 Dec 24, 2016

Copy link to clipboard

Copied

üSTÜNE ÇİKOLATA SOSUDA İSTERMİSİN

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 ,
Dec 24, 2016 Dec 24, 2016

Copy link to clipboard

Copied

Sure, of course.

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
LEGEND ,
Dec 24, 2016 Dec 24, 2016

Copy link to clipboard

Copied

Hi,

Screenshot! Thanks!

(^/)

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 ,
Dec 24, 2016 Dec 24, 2016

Copy link to clipboard

Copied

Before:

And After:

Thanks.

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
LEGEND ,
Dec 24, 2016 Dec 24, 2016

Copy link to clipboard

Copied

Thanks!

Don't forget it's Christmas soon and some bottles are over yet! … 

… If I understood what you mean, you have this:

Capture d’écran 2016-12-24 à 14.16.33.png

As I saw, you seem to use a "condition"! … and you would like to get this!

Capture d’écran 2016-12-24 à 14.07.21.png

For that, try this [just change the condition name! Here = "Test"]:

app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.ENTIRE_SCRIPT, "Extract Conditional Text! …");

function main()    

    {

        var myDoc = app.activeDocument;

        var myCondition = "Test"; 

        app.findGrepPreferences = app.changeGrepPreferences = null; 

        app.findGrepPreferences.appliedConditions = [myCondition]; 

        var myFound = myDoc.findGrep();

        var F = myFound.length;

        for (i = 0; i < F ; i++){

            var myF = myFound;

            myF.parent.texts.everyItem().appliedConditions = []; 

            if ( ( myP = myF.parentTextFrames[0].parent.parent ) instanceof Character )

            {

                myF.parent.texts.everyItem().move(LocationOptions.BEFORE, myP);

                myP.contents = "\r";

            }

            else if ( ( myP = myF.parentTextFrames[0].parent ) instanceof Character )

            {

                myF.parent.texts.everyItem().move(LocationOptions.BEFORE, myP);

                myP.contents = "";

            }

        }

    alert(F + " done!\r\rMerry Christmas and Happy Holidays!!\r\r(^/)")

   

   }

It's a simple Grep research based on your condition! …

Capture d’écran 2016-12-24 à 14.07.51.png

What else! … Maybe a new toast!  Hips! 

(^/)

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 ,
Dec 24, 2016 Dec 24, 2016

Copy link to clipboard

Copied

Thanks for everything. Happy Christmas. 😄

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
LEGEND ,
Dec 24, 2016 Dec 24, 2016

Copy link to clipboard

Copied

… It's not because The Force is a powerful ally that things seem to be so simple! …

… and, according to my master Yoda:

"Full of certainties you are, not a Jedi you'll become!"

This script new version is formidable because it preserves the styles applied!

Capture d’écran 2016-12-24 à 16.46.03.png

Capture d’écran 2016-12-24 à 16.46.32.png

Capture d’écran 2016-12-24 à 16.47.11.png

Capture d’écran 2016-12-24 à 16.47.00.png

app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.ENTIRE_SCRIPT, "Extract Conditional Text! …");

function main()    

    {

        var myDoc = app.activeDocument,

        myCondition = "Test";

       

        app.findGrepPreferences = app.changeGrepPreferences = null; 

        app.findGrepPreferences.findWhat = "(?-s).+";

        app.findGrepPreferences.appliedConditions = [myCondition];

        app.changeGrepPreferences.changeTo = "\\r$0\\r";

        myDoc.changeGrep();

        app.findGrepPreferences = app.changeGrepPreferences = null; 

        app.findGrepPreferences.findWhat = "(?s).+";

        app.findGrepPreferences.appliedConditions = [myCondition];

       

        var myFound = myDoc.findGrep(),

        F = myFound.length;

        for (i = 0; i < F ; i++){

           

            var myF = myFound;

            myF.parent.texts.everyItem().appliedConditions = []; 

            if ( ( myP = myF.parentTextFrames[0].parent.parent ) instanceof Character  ||  ( myP = myF.parentTextFrames[0].parent ) instanceof Character )

            {

                myF.parent.texts.everyItem().move (LocationOptions.BEFORE, myP);

                myP.contents = "";

            }

        }

        app.findGrepPreferences = app.changeGrepPreferences = null;

        app.findGrepPreferences.findWhat = "^\\h*\\r";

        app.changeGrepPreferences.changeTo = "";

        myDoc.changeGrep();

       

        app.findGrepPreferences = app.changeGrepPreferences = null;

    alert( F + " done!\r\rMerry Christmas and Happy Holidays!!\r\r(^/)" )

   

   }

[To be evaluated!]  Thanks for your comments! 

(^/)

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
LEGEND ,
Dec 24, 2016 Dec 24, 2016

Copy link to clipboard

Copied

Thanks to definitively make this last answer as "correct"!

Thanks!

(^/) 

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 ,
Dec 24, 2016 Dec 24, 2016

Copy link to clipboard

Copied

LATEST

Great! 😄 Thank you so much. Really does work it.

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