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

[SCRIPT] noBreak property just turns ON

Enthusiast ,
Jan 05, 2021 Jan 05, 2021

Does anyone know why the noBreak property just works when it's turned ON by the script?

I tried all the ways I imagine (because the AI scripting documentation is poor) and nothing works.

 

For example, these are working:

app.selection.noBreak = true;
app.selection.characterAttributes.noBreak = true;

 

But these are not working:

app.selection.noBreak = false;
app.selection.characterAttributes.noBreak = false;

 

Adobe is really working hard on disappoint developer community.

TOPICS
Scripting
540
Translate
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
Adobe
Community Expert ,
Jan 05, 2021 Jan 05, 2021

it only works if you turn System Layout ON in the Character Panel.

Translate
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
Enthusiast ,
Jan 05, 2021 Jan 05, 2021

Nice, @CarlosCanto. Is there a way to check this option's status with script?

Translate
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 ,
Jan 05, 2021 Jan 05, 2021
LATEST

I looked for a way but found none unfortunately.  

 

I found out however that if you turn Auto Kern off, it works. But...there is always a but, turning Auto back on doesn't seem to work. Perhaps it does work, except the UI does not update.

 

see if it this doen't mess up your kerning

 

selection.characterAttributes.kerningMethod = AutoKernType.NOAUTOKERN;
selection.characterAttributes.noBreak = false; // it doesn't work unless Auto Kern if off or if System Layout is ON

 

Translate
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