Copy link to clipboard
Copied
Hello everyone,
I worked a lot on a script that changes all the paragraphs of my document to single column instead of span column for performance reasons. This script must also change all the paragraphs back to their original value if run again. So I had the idea to use a "string" attribute of paragraphs that seems not used at all. I found in the documentation (https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Paragraph.html) RubyString and change the original value to {1} or {0} (span column or single column (the original value is empty). This way I can save and close my document and those variables remain.
If I understood, Ruby is for the japanese version of indesign. So as an european user who won't need ruby, is that ok to use it this way? Is there any restriction in indesign that could change this value other than with my script? Or maby another way I didn't think about?
All the best,
Nicolas
P.S. I'm using indesign 2020, last build on mac os catalina.
Hi Brian,
there is no property label in the ExtendScript DOM for paragraph objects. Or any other texts objects.
So I think that the idea of Nicolas is very good one. Unless a user with a Japanese version of InDesign opens and changes the document or another script that implemented the same idea is run on the text, everything should work as expected.
A different idea would be to apply a condition.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
I'll be watching this thread, hoping real experts answer, but I wonder this: Why not simple use a script toggle between Span Columns and Single Column? If the paragraph is spanning columns, change it to single column. And vice versa.
Copy link to clipboard
Copied
Hi Robert,
Good question, the thing is some paragraphs should stay single all the time, so a toggle wouldn't work without knowing the initial value. That's why I needed to "attach" a variable to each paragraphs.
Nicolas
Copy link to clipboard
Copied
I would just tag each paragraph that's changed with a label flag: myPar.label = "changed";
Then, when you run the script:
if (myPar.label == "changed") {
set span...
myPar.label = "";
}
Copy link to clipboard
Copied
Hi Brian,
there is no property label in the ExtendScript DOM for paragraph objects. Or any other texts objects.
So I think that the idea of Nicolas is very good one. Unless a user with a Japanese version of InDesign opens and changes the document or another script that implemented the same idea is run on the text, everything should work as expected.
A different idea would be to apply a condition.
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
That's what I get for responding before coffee.
Copy link to clipboard
Copied
Or, insert a note into the para. Although, the note might get deleted.
P.
Copy link to clipboard
Copied
Thanks Uwe