1 Reply Latest reply on Aug 26, 2009 5:15 PM by sstanleyau

    AppleScript - CS3 - Find and Replace Text from selected pages

    jo2mendoza

      I have a plain AppleScript that finds and replaces text. But my script replaces it in all the pages. I just want to search and replace on certain pages. For example, I have a 10 page document.  I just want to replace the text "John" to "Steve" on pages 3 - 5.

       

      My current AppleScript is as follows:

       

      tell application "Adobe InDesign CS3"

      set find text preferences to nothing

      set change text preferences to nothing

       

      --Search the document for the string "John".

      set find what of find text preferences to "John"

       

       

      --Replace the search with Steve

      set change to of change text preferences to "Steve"

       

       

      -- this is the actual search and replace command

       

      set myFoundItems to change text

       


      end tell

       

      What command do I need to make the search and replace only from page 3 to 5?

       

      Thanks in advance.