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
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+
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.");
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.
Copy link to clipboard
Copied
Hi Pickory,
Yeah..Good catch.. without those 'while' also script will perform as desired
Thanks for your thoughts.
Karthi
Copy link to clipboard
Copied
I started writing a plugin for this, 3 years ago, nearly finished it!
Copy link to clipboard
Copied
Or pink ( red )
Copy link to clipboard
Copied
Dear Tpk
Very very thank you so much!!!!!!!! for your helping skills
Thanks
kathik
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
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.
Copy link to clipboard
Copied
Dear Pickory
Okay, i understand Pickory
Thanks
Karthik
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
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?
Thanks
karthik
Copy link to clipboard
Copied
Just select any text frame and run the script...
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
Copy link to clipboard
Copied
Glad to help you, karthik
Copy link to clipboard
Copied
Thanks tpk
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!!!
Copy link to clipboard
Copied
Hello, Pickory, I would love to have this function! Is the plug-in available? Thanks!