Skip to main content
Known Participant
February 14, 2011
Answered

Delete space from para style name

  • February 14, 2011
  • 2 replies
  • 674 views

Hi All,

There are some space character at the end of my paragraph style naming.

How can we delete [space] only from at the end of the paragraph style name? I don't want to delete [space] if it is coming between paragraph style naming.

Please provide the js code.

Thanks,

Tansk

This topic has been closed for replies.
Correct answer _Jongware_-9BC6tI
Please provide the js code.

Oh sure, you are in a hurry, right?

Can you not call upon the scripting forum for every menial task? Please? In these six hours you were twiddling your thumbs and nervously checking the forum every five minutes or so, you could have done this by hand.

Oh whatever:

for (p=2; p<app.activeDocument.paragraphStyles.length; p++)

     app.activeDocument.paragraphStyles

.name = app.activeDocument.paragraphStyles

.name.replace(/\s+$/,'');

2 replies

_Jongware_-9BC6tICorrect answer
Inspiring
February 14, 2011
Please provide the js code.

Oh sure, you are in a hurry, right?

Can you not call upon the scripting forum for every menial task? Please? In these six hours you were twiddling your thumbs and nervously checking the forum every five minutes or so, you could have done this by hand.

Oh whatever:

for (p=2; p<app.activeDocument.paragraphStyles.length; p++)

     app.activeDocument.paragraphStyles

.name = app.activeDocument.paragraphStyles

.name.replace(/\s+$/,'');

tansk02Author
Known Participant
February 15, 2011

I was not in hurry. I post my question mistakenly again.

Anyway, thanks for your reply.

tansk02Author
Known Participant
February 14, 2011

h