• 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: Escaping Quote Characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Escaping Quote Characters (From: Dave <email@hidden>)
 >Re: Escaping Quote Characters (From: Andrew Oliver <email@hidden>)
 >Re: Escaping Quote Characters (From: Dave <email@hidden>)

  • Prev by Date: Re: Escaping Quote Characters
  • Next by Date: Re: Escaping Quote Characters
  • Previous by thread: Re: Escaping Quote Characters
  • Next by thread: Re: Escaping Quote Characters
  • Index(es):
    • Date
    • Thread