Escape a Backslash

I need to set a variable to a backslash and a single quote for use with some command line scripting. In effect I’d like to do:

set x to "\'"

I know that needs to be escaped but for the life of me I can’t figure out how. I even copied this from the FAQ and ran it:

set theString to "This is a sentence containing a backslash (\\)."

but I get this as a result:
“This is a sentence containing a backslash (\).”

Which has two backslashes instead of one as expected. Is this broken in OS 10.4.4 using AppleScript 1.10.3? Can anyone else confirm this?

Thanks in advance,
Dan

Never mind :smiley:

I was looking at the result in Script Editor which showed two backslashes. If I display the variable in a display dialog it looks right.

So to escape the backslash and quote I had to use:

set x to "\\" & "'"

Dan

This will work fine:

set x to "\\'"