Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

FindChagebyList with grouped styles

Return to Member Forum

  • Author
    Posts
    • #115704
      Alberto Gutierrez
      Participant

      Hi there, I have found and issue trying to apply a character style which is inside a group folder. If I open the supporting text file of the script (FindChangeList.txt) I see this example of style application:

      //text {findWhat:”^9^9.^9^9″} {appliedCharacterStyle:”price”} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find $10.00 to $99.99 and apply the character style “price”.

      That works if the style “price” is in the «root» directory of character styles. If it is inside a folder the scripts shows up an error. I have tried to add the name of the containing folder and a slash before the name of the style (appliedCharacterStyle:”my_ch_styles/price”) with no success.

      ¿Any clue? Thanks in advance.

    • #115705
      Vinny –
      Member

      Hi

      try this: (change “group” by your folder name)

      text {findWhat:”^9^9.^9^9″} {appliedCharacterStyle:app.activeDocument.characterStyleGroups.item(“group”).characterStyles.item(“price”)} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}

    • #115707
      Alberto Gutierrez
      Participant

      Thanks for your answer Vinny. I tried your expression with a paragraph style, changing the word “character” for “paragraph”:

      text {findWhat:”<0016>”} {appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item(“tablas”).paragraphStyles.item(“tab_texto”)}

      And i get the error message, is there any semantic difference between character and paragraph?

    • #115749
      Vinny –
      Member

      Hi Alberto.

      Yes, the syntax is similar.
      I can think of two reasons for the thrown error:

      – You have to add options at the end of your line in order to comply with the syntax. A minima, add a tab followed by {}
      – WordPress changes straight quotes to curly ones. Nicer to read for sure, but not got when it comes to code ^^ Make sure you change those curly quotes into straight ones in your FindChangeList.txt file.

      By the way, what are you trying to catch with <0016>? I’m curious about it…

    • #115759
      Alberto Gutierrez
      Participant

      I made sure that the quotes are straight and the actual syntax is:

      text {findWhat:”<0016>”} {appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item(“tablas”).paragraphStyles.item(“tab_texto”)} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}

      I still get the error 25 message. <0016> finds a table, and in this case applies the paragraph style tab_texto.

    • #115760
      Vinny –
      Member

      Aah right! Table! (“tablas”… how did I miss that?)

      I remember this great Indesignsecrets tip now ^^

      Anyway… When I copy/paste your code, I noticed a space instead of a tab before the options.
      Check that out…

      Otherwise, I’m running out of ideas… It works fine for me!

    • #115761
      Alberto Gutierrez
      Participant

      Bingo Vinny! it was exactly that: instead a space it needed a tab.

      All working fine, thanks!.

Viewing 6 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads