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

Primary Text Frame/Smart Text reflow not cooperating with my javascript

Community Expert ,
Jan 16, 2017 Jan 16, 2017

Copy link to clipboard

Copied

Hello all.

I've created a javascript that makes a quick manifest spreadsheet for me because I'm sick of creating them out of Excel.

It effectively creates a new document that contains a primary text frame and creates a table based on two fields from the UI, none of which are relevant to the issue. It then opens an export PDF location dialog box, and when a folder is chosen, it bases the filename on input from the UI at the start of the script, and then closes the ID file without saving.

The script works fine... provided that the manifest is one page long. However, there will be instances where the manifest may be several pages long.

In instances where the table is longer than one page, the script runs fine until the prompt asks to save the PDF, the ID file in the background is one page long and has an overset text icon. If I remove the export and file close lines, the script successfully generates a multi-page document.

I've tried using $.sleep between the last text formatting function and the export instruction, but it just idles for a the appropriate time and the outcome is the same... 1 page with overset text. I've tried making an if overset text... $.sleep, but again the outcome is the same.

The script is long and boring but for those interested, it can be found here: https://dl.dropboxusercontent.com/u/55743036/HPSmanifest.jsx

Is there some kind of bug here, or am I missing something? I read the following thread How do I "shift-place" text?  and I'm sure my answer lies in here, but the primary text frame/smart text reflow solution should work... right?

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!
TOPICS
Scripting

Views

669

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
People's Champ ,
Jan 16, 2017 Jan 16, 2017

Copy link to clipboard

Copied

Hi Colin,

$.sleep will hang indesign so it's helpless in your case.

A quick fix could be to work in two times. As it seems your script works fine without export. You can have a main routine calling for two sub routines. The first one will do all but PDF then close file. The second reopens and do export then close it again. I know it's cumbersome but it could avoir your issues.

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 27, 2019 Jul 27, 2019

Copy link to clipboard

Copied

LATEST

Hi Colin,

I also have experienced the same concern but it is resolved by adding a textframe in pasteboard and link the last page text to the textframe and remove it through javascript and then close the document. There is no overset occurs.

Thanks,

Subathra

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