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?
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.
Copy link to clipboard
Copied
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