Skip to main content
Known Participant
October 19, 2010
Answered

FindChangeByList script question, re: when a style is part of a style group

  • October 19, 2010
  • 1 reply
  • 1453 views

Hi,

I'm using InDesign's FindChangeByList script and am running into a problem.

Here is the problem line:

grep {findWhat:"^."} {appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item("Text").paragraphStyles.item("Body2.TextIndent"), changeConditionsMode:1919250519} {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true} //Change everything to Text.indent2 style

What I am trying to do is format every paragraph with the style called "Body2.TextIndent" which is located in my style sheets under a group called "Text"

This line is not working for me; I get a JavaScript  "Error #17. Error string: variable name expected."

Please note that I CAN get this line to work just fine if I use a style that is NOT in a group. For instance, this line works fine for me:

grep {findWhat:"^."} {appliedParagraphStyle:"Body2.TextIndent", changeConditionsMode:1919250519} {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true} //Change everything to Text.indent2 style

The problem is apparently that the FindChangeByList script doesn't like style groups. I found this by Googling the internet and found this link:

http://www.listsearch.com/indesign/Thread/index.lasso?17986

Can anyone help?

Thanks.

This topic has been closed for replies.
Correct answer Kasyan Servetsky

Which version of InDesign do you use?

The following line works for me on CS3, Mac.

grep     {findWhat:"^."}     {appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item("Text").paragraphStyles.item("Body2.TextIndent")}     {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true}     //Change everything to Text.indent2 style

Kasyan

1 reply

Kasyan Servetsky
Kasyan ServetskyCorrect answer
Legend
October 19, 2010

Which version of InDesign do you use?

The following line works for me on CS3, Mac.

grep     {findWhat:"^."}     {appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item("Text").paragraphStyles.item("Body2.TextIndent")}     {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true}     //Change everything to Text.indent2 style

Kasyan

Known Participant
October 19, 2010

Kasyan, it works for me now! THANKS! One thing... I notice that in your line, you removed the part "changeConditionsMode:1919250519". Maybe that was the problem? I'm new to scripting. What does that line do? Can I leave it out?

p.s. I'm using CS4 on Windows XP Pro

Kasyan Servetsky
Legend
October 19, 2010

It means that change replaces applied conditions. Yes, you can do without it.