Wednesday, March 21, 2018

#1 2012-10-19 08:51:25 am

Registered: 2010-09-16
Posts: 5

Trying to write a grep style applescript

Whenever I try and compile a grep style script it either performs the code IE puts a hard return in the script or tells me unknown token meaning it is reading the \ between the quotes as a return. What can be done? i am sure there is an easy fix and I think scripting grep styles could be huge.

tell application "Adobe InDesign CS4"
    set find grep preferences to nothing
    set change grep preferences to nothing
    --Search the document for the string "\r\s*$".
    set find what of find grep preferences to "\r\s*$" as string
    --Replace the search with blank
    set change to of change grep preferences to " "
    -- this is the actual search and replace command
    set myFoundItems to change text
end tell



#2 2012-10-19 04:26:47 pm

Shane Stanley
From:: Australia
Registered: 2002-12-07
Posts: 5253

Re: Trying to write a grep style applescript

You have to escape the backslashes with another backslash.

Shane Stanley <>



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)