4 Replies Latest reply on Nov 3, 2009 6:19 AM by allisonblake

    [AS][CS3] scripting find/repalace with style groups

    allisonblake Level 1

      Hi everyone,

      I've been struggling with this problem for a while and hope someone can shed some light.

      I am trying to use applescript to run a series of find/replace queries.

      For instance:


      tell application "Adobe InDesign CS3"
          set applied paragraph style of find text preferences to "Text"
          set font style of find text preferences to "Book Italic"
          set applied character style of change text preferences to "Book Italic"
          tell document 1
              change text
          end tell
      end tell


      This works beautifully unless the document has styles inside style groups, in which case I get an error saying

      "Adobe InDesign CS3 got an error: Invalid value for set property 'applied paragraph style'.

      Expected string, paragraph style or nothing, but received "Text"."


      If doing the find/replace manually, the paragraph style shows up as Text (Main) indicating that Text is inside the style group Main.

      How do I specify this in the script?