2 Replies Latest reply on Apr 27, 2010 7:37 AM by jdmart

    Unknown Token for my GREP call out?

    jdmart

      I am using the bellow script to run a grep find and change in inDesign.  The script in general works with a substituted command for a "text" find and change.  The grep works as a stand alone search - that is, manually inputed into the "find and replace" search box.  When I run it in the script here, it errors out and says unknown token. And something about  - """" - frustrating...  Any help would be greatly appreciated.

       

      tell application "Adobe InDesign CS4"

      set myDocument to document 1

      set myPage to page 1 of myDocument

      set myTextFrame to text frame 1 of myPage

      --Clear the find/change preferences.

      set find grep preferences to nothing

      set change grep preferences to nothing

      --Regular expression for finding an email address.

      set find what of find grep preferences to "^#\s\w.+$"

      --Apply the change to 24-point text only.

      set point size of change grep preferences to 50

      tell myDocument

      change grep

      end tell

      --Clear the find/change preferences after the search.

      set find grep preferences to nothing

      set change grep preferences to nothing

      end tell

       

      The text I am "calling out" is a piece of markdown:

       

       

      "     #     Introduction     "  Quotes omitted.