Re: Escaping Quote Characters
Re: Escaping Quote Characters
- Subject: Re: Escaping Quote Characters
- From: "Stockly, Ed" <email@hidden>
- Date: Tue, 05 Apr 2016 17:32:26 +0000
- Thread-topic: Escaping Quote Characters
If I fix the smart quote and run this, with both version of your script,
the second version add a ")" to the end of the string.
———————
set myVBAString to return
set myVBAString to myVBAString & "strPropertyName = " & quote & "DocProp1"
& quote & linefeed
set myVBAString to myVBAString & "varValue = " & quote & "DocProp1 Value"
& quote & linefeed
set myVBAString to myVBAString & "strPropertyName = \"DocProp1\"" &
linefeed
set myVBAString to myVBAString & "varValue = \"DocProp1 Value)\"" &
linefeed
return myVBAString
-—>strPropertyName = "DocProp1"
varValue = "DocProp1 Value"
strPropertyName = "DocProp1"
varValue = "DocProp1 Value)"
On 4/5/16, 9:53 AM,
"applescript-users-bounces+ed.stockly=email@hidden on
behalf of Dave"
<applescript-users-bounces+ed.stockly=email@hidden on
behalf of email@hidden> wrote:
>Hi,
>
>> On 5 Apr 2016, at 16:27, Andrew Oliver <email@hidden> wrote:
>>
>> You’re right - Script Editor adds the quotes in the output to
>>demonstrate the fact there is an embedded quote within the string
>>object. Nothing to worry about.
>>
>
>Except that I couldn’t get it to work using that syntax, when I tried
>this:
>
> set myVBAString to myVBAString & "strPropertyName = " & quote &
>"DocProp1" & quote & linefeed
> set myVBAString to myVBAString & "varValue = " & quote & "DocProp1
>Value" & quote & linefeed
>
> it worked, but the output looks the same. So I’m wondering what is wrong?
>
>Cheers
>Dave
>
>
> _______________________________________________
>Do not post admin requests to the list. They will be ignored.
>AppleScript-Users mailing list (email@hidden)
>Help/Unsubscribe/Update your Subscription:
>imes.com
>Archives: http://lists.apple.com/archives/applescript-users
>
>This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden