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

How to highlight tracking value in the java script

Contributor ,
Feb 10, 2016 Feb 10, 2016

Copy link to clipboard

Copied

Dear friends


I have learn InDesign scripting.  I have very little experience. i want to your help.

I want to highlight for all tracking value in above +15 and -15 in the Indesign (Cs6) files.


Thanks

karthik S



TOPICS
Scripting

Views

793

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

Guide , Feb 10, 2016 Feb 10, 2016

Hi Karthik,

Here it is...

theTextR = app.selection[0].parentStory.textStyleRanges;

try

{

app.activeDocument.colors.item("Overtracked").name;

}

catch (myError){

app.activeDocument.colors.add ({name:"Overtracked",space:ColorSpace.CMYK,colorValue:[15,100,100,0]});

}

var i=0;

while (i<theTextR.length)

{

if (theTextR.tracking <= -15 || theTextR.tracking >= 15)

{

while (i<theTextR.length && (theTextR.tracking <= -15 || theTextR.tracking >= 15))

{

theTextR.fillColor = "Overtracked";

i+

...

Votes

Translate

Translate
Guide ,
Feb 10, 2016 Feb 10, 2016

Copy link to clipboard

Copied

Hi Karthik,

Here it is...

theTextR = app.selection[0].parentStory.textStyleRanges;

try

{

app.activeDocument.colors.item("Overtracked").name;

}

catch (myError){

app.activeDocument.colors.add ({name:"Overtracked",space:ColorSpace.CMYK,colorValue:[15,100,100,0]});

}

var i=0;

while (i<theTextR.length)

{

if (theTextR.tracking <= -15 || theTextR.tracking >= 15)

{

while (i<theTextR.length && (theTextR.tracking <= -15 || theTextR.tracking >= 15))

{

theTextR.fillColor = "Overtracked";

i++;

}

} else

i++;

}

alert("The tracking value more than -15  and +15 is highlighted in Red color.");

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
Guide ,
Feb 11, 2016 Feb 11, 2016

Copy link to clipboard

Copied

Hi tpk,

That is beautiful in its simplicity. I think you might be able to make it a little bit simpler. I haven't tried it, but the inner while could be removed ( I think ).

Very nice though!

P.

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
Guide ,
Feb 11, 2016 Feb 11, 2016

Copy link to clipboard

Copied

Hi Pickory,

Yeah..Good catch.. without those 'while' also script will perform as desired

Thanks for your thoughts.

Karthi

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
Guide ,
Feb 11, 2016 Feb 11, 2016

Copy link to clipboard

Copied

I started writing a plugin for this, 3 years ago, nearly finished it!

Screen Shot 2016-02-11 at 16.12.57.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
Guide ,
Feb 11, 2016 Feb 11, 2016

Copy link to clipboard

Copied

Or pink ( red )

Screen Shot 2016-02-11 at 18.31.57.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
Contributor ,
Feb 11, 2016 Feb 11, 2016

Copy link to clipboard

Copied

Dear Tpk

Very very thank you so much!!!!!!!! for your helping skills


Thanks

kathik



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
Contributor ,
Feb 11, 2016 Feb 11, 2016

Copy link to clipboard

Copied

Dear Pickory

How to done two colors control the script. one help friend.

Plz send your coding

Thanks

Karthik s

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
Guide ,
Feb 11, 2016 Feb 11, 2016

Copy link to clipboard

Copied

Karthiks,

its an experimental plugin, this thread promoted me to nearly finish it. just a bit of fun. Tpk's, script is better.

Best.

P.

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
Contributor ,
Feb 11, 2016 Feb 11, 2016

Copy link to clipboard

Copied

Dear Pickory

Okay, i understand Pickory

Thanks

Karthik

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
Guide ,
Feb 11, 2016 Feb 11, 2016

Copy link to clipboard

Copied

Hi Karthik,

Here is revised script which used 2 color for differentiating positive and negative tracking.

theTextR = app.selection[0].parentStory.textStyleRanges; 

try 

app.activeDocument.colors.item("PositiveOvertracked").name; 

catch (myError){ 

app.activeDocument.colors.add ({name:"PositiveOvertracked",space:ColorSpace.CMYK,colorValue:[100,15,100,0]}); 

try 

app.activeDocument.colors.item("NegativeOvertracked").name; 

catch (myError){ 

app.activeDocument.colors.add ({name:"NegativeOvertracked",space:ColorSpace.CMYK,colorValue:[15,100,100,0]}); 

}  

 

var i=0; 

while (i<theTextR.length) 

        if (theTextR.tracking >= 15) 

        

        { 

        theTextR.fillColor = "PositiveOvertracked"; 

        i++; 

        

        }

        else if (theTextR.tracking <= -15)

        {

            theTextR.fillColor = "NegativeOvertracked"; 

        i++; 

           

            }

else 

  {

 

i++; 

 

  }

}  

alert("The tracking value more than +15  and -15 is highlighted in PositiveOvertracked and NegativeOvertracked color respectively."); 

PS: Pickory, I don't have knowledge in plugin development. But eager to see how yours work

Regards,

Karthi

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
Contributor ,
Feb 11, 2016 Feb 11, 2016

Copy link to clipboard

Copied

Dear Tpk

Thanks your 2 coding tpk.

I have run your script, if i get one error comments. I have attached screenshot for your reference.

I don't now how to clear this type of problem. what can i do?

123.png

Thanks

karthik

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
Guide ,
Feb 11, 2016 Feb 11, 2016

Copy link to clipboard

Copied

Just select any text frame and run the script...

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
Contributor ,
Feb 11, 2016 Feb 11, 2016

Copy link to clipboard

Copied

Dear Tpk

Thank thank thank so match Tpk. your script working good. I like so match

I need your help continued.

karthik

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
Guide ,
Feb 11, 2016 Feb 11, 2016

Copy link to clipboard

Copied

Glad to help you, karthik

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
Contributor ,
Feb 11, 2016 Feb 11, 2016

Copy link to clipboard

Copied

Thanks tpk

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 15, 2023 Dec 15, 2023

Copy link to clipboard

Copied

Hello, tpk, I have been looking for exactly this script! It doesn't seem to work in InDesign 2020. Has it been updated? 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 15, 2023 Dec 15, 2023

Copy link to clipboard

Copied

LATEST

Hello, Pickory, I would love to have this function! Is the plug-in available? 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