Skip to main content
Timothy Bennett
Inspiring
February 26, 2021
Answered

InDesign - .remove() styles default behaviour

  • February 26, 2021
  • 1 reply
  • 345 views

Hi InDesign scripters!
I am pretty new to ID scripting, but have lots of experience of CEP for Photoshop.
I have a query about the .remove() method for styles that I hope someone can shed a bit more light on than the documentation.
The .remove() method appears to preserve formatting by default, but I would like to confirm that this is actually the case as I can't find any explicit reference in the docs (both offical and Jongware).
My own tests seem to indicate that this is the case, but I'm not knowledgeable enough about ID to predict any edge cases where where the formatting might not be preserved upon executing .remove(), and I need a bit more confidence than "it just works"!

Thanks in advance!

This topic has been closed for replies.
Correct answer rob day

Yes, unless you add the replacing with parameter, the formatting is not changed. It would be the equivalent of selecting a paragraph and choosing Break Link to Style from the Paragraph Styles panel.

1 reply

rob day
Community Expert
rob dayCommunity ExpertCorrect answer
Community Expert
February 26, 2021

Yes, unless you add the replacing with parameter, the formatting is not changed. It would be the equivalent of selecting a paragraph and choosing Break Link to Style from the Paragraph Styles panel.

Timothy Bennett
Inspiring
February 26, 2021

Amazing, thanks for that Rob!