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

Apply *JSXBIN Script to all Pages

Explorer ,
Aug 29, 2018 Aug 29, 2018

Copy link to clipboard

Copied

Hi i have JSXBIN script & i Want To apply it on all pages,

all pages basically have TextBoxs & script basically just change size of the Text.

since it is in JSXBIN format, i cannot edit it.

what should i do.

plz help me

TOPICS
Scripting

Views

1.0K

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

Community Expert , Aug 29, 2018 Aug 29, 2018

Try the following

var myLayer = app.activeDocument.layers.itemByName("FitWord");

for(var counter = 0; counter < myLayer.textFrames.length; counter++) 

  app.select(myLayer.textFrames[counter]) 

  app.doScript("/Users/katrodiyadhaval/Desktop/jsxbintest.jsxbin");     //Change this to the path of your jsxbin 

}

Votes

Translate

Translate
Community Expert ,
Aug 29, 2018 Aug 29, 2018

Copy link to clipboard

Copied

If the jsxbin works fine on a single page then you can write an new script that calls up the jsxbin on all the pages. Look for doScript method it should be of use to you in this case.

-Manan

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 ,
Aug 29, 2018 Aug 29, 2018

Copy link to clipboard

Copied

hi thanx for such a quick reply, & yes the script works perfectly fine on single page

let Me describe how this script is working :

First, I have to select TextBox & then the Script do its job.

If you run Script without selecting the TextBox, it say's [ No Text Selected! ]

I don't know about scripting, plz help

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 ,
Aug 29, 2018 Aug 29, 2018

Copy link to clipboard

Copied

Try the code below

for(var i = 0; i < app.activeDocument.textFrames.length; i++)

{

  app.select(app.activeDocument.textFrames)

  app.doScript("/Users/katrodiyadhaval/Desktop/jsxbintest.jsxbin");     //Change this to the path of your jsxbin

}

This should work if all the jsxbin needs is a text frame selected.

-Manan

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 ,
Aug 29, 2018 Aug 29, 2018

Copy link to clipboard

Copied

ok let me try

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 ,
Aug 29, 2018 Aug 29, 2018

Copy link to clipboard

Copied

i have tried your code,but it worked for 1st & 2nd Page. but then on 3rd page process stuck on continuous loop.

by the way, i am using Indesign CC 2018

& Textbox is inside a layer named "FitWord"

& the Script i am using is FillTextFrame.jsxbin

Link : Fun With Text Fitting in InDesign | in-tools.com

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 ,
Aug 29, 2018 Aug 29, 2018

Copy link to clipboard

Copied

I don't see why it should get stuck in a loop. Send me the document that has this issue, i will have a look.

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 ,
Aug 29, 2018 Aug 29, 2018

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
Community Expert ,
Aug 29, 2018 Aug 29, 2018

Copy link to clipboard

Copied

change the variable from i to counter in the code that i gave and then run it, it should work.

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 ,
Aug 29, 2018 Aug 29, 2018

Copy link to clipboard

Copied

Yes it worked thank you so much.

but your script select all textBoxs, i just want to select : a Textbox, that is inside a layer named "FitWord"

because there will be many other textboxs in same page, i don't want to appy JSXBIN script to all textboxes of same page.

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 ,
Aug 29, 2018 Aug 29, 2018

Copy link to clipboard

Copied

Try the following

var myLayer = app.activeDocument.layers.itemByName("FitWord");

for(var counter = 0; counter < myLayer.textFrames.length; counter++) 

  app.select(myLayer.textFrames[counter]) 

  app.doScript("/Users/katrodiyadhaval/Desktop/jsxbintest.jsxbin");     //Change this to the path of your jsxbin 

}

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 ,
Aug 30, 2018 Aug 30, 2018

Copy link to clipboard

Copied

LATEST

You made my day, thank you thank you so much

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 ,
Aug 29, 2018 Aug 29, 2018

Copy link to clipboard

Copied

Hi i am using Batch processor script to run my script.

but as i mention above first i need to select all textboxs on all pages.

otherwise script says [ No Text Selected! ]

So how can i select all TextBox ?

by the way the Textbox is inside a layer named "FitWord"

Link : Batch processor

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