• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Replacing braces in search and replace strings "{" and "}"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Replacing braces in search and replace strings "{" and "}"


  • Subject: Re: Replacing braces in search and replace strings "{" and "}"
  • From: "Arthur J Knapp" <email@hidden>
  • Date: Sat, 27 Jan 2001 13:20:20 -0500

> Date: Fri, 26 Jan 2001 22:49:12 +0100
> To: Bill Planey <email@hidden>,
> From: Emmanuel <email@hidden>
> Subject: Re: Replacing braces in search and replace strings "{" and "}"

> At 22:00 +0100 26/01/01, Bill Planey wrote:
>>I need to automate a search and replace function in MS Word with pattern
>>matching turned on. Braces ( "{" and "}" ) already have special meaning
>>in AppleScript (as well as the pattern matching feature of search and
>>replace in Word). How can I get my find string to contain braces?

Whoops, I missed this thread.

Braces have a "special" meaning in the AppleScript language. But
aren't you talking about the contents of a string? Braces have no
special significance inside AppleScript strings:

"Bill {The Great} Planey"

If word is using some sort of wild-card or regular expression
scheme, then it probably has it's own means of "escaping" literal
characters.

Try using: "\\{" and "\\}" to represent "{" and "}".

Note: That is to say, you are using a single backslash to escape
the special character, and an additional backslash to escape
the backslash.

In AppleScript strings, these are the only string sequences that
are not literal:

\t = tab
\r = return
\" = "
\\ = \



--
{
Arthur J Knapp, of STELLARViSIONs ;

http://www.STELLARViSIONs.com ;

mailto:email@hidden ;

http://developer.apple.com/techpubs/
macos8/InterproCom/AppleScriptScripters/
AppleScriptLangGuide/
}


  • Follow-Ups:
    • Re: Replacing braces in search and replace strings "{" and "}"
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: scripts wont compile since 9.1
  • Next by Date: Re: Maximum script lenght ?!??
  • Previous by thread: Re: Replacing braces in search and replace strings "{" and "}"
  • Next by thread: Re: Replacing braces in search and replace strings "{" and "}"
  • Index(es):
    • Date
    • Thread