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

What is RubyString and can I use it this (no meant for that) way?

Explorer ,
Sep 09, 2020 Sep 09, 2020

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.htmlRubyString 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.

TOPICS
Scripting

Views

305

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 , Sep 09, 2020 Sep 09, 2020

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 )

Votes

Translate

Translate
Engaged ,
Sep 09, 2020 Sep 09, 2020

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.

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 ,
Sep 10, 2020 Sep 10, 2020

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

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 ,
Sep 09, 2020 Sep 09, 2020

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 = "";    

}

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 ,
Sep 09, 2020 Sep 09, 2020

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 )

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 ,
Sep 09, 2020 Sep 09, 2020

Copy link to clipboard

Copied

That's what I get for responding before coffee.

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
Guide ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

Or, insert a note into the para. Although, the note might get deleted.

 

P.

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 ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

LATEST

Thanks Uwe

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