5 Replies Latest reply on Nov 14, 2016 9:57 AM by hillen

    Errors trying to escape quotes in AppleScript

    hillen

      I have a Filemaker scrip that executes an apple script step.  That step says this:

       

      SetClipboardAppleScrip ( "<SPAN STYLE=color: #3b6f99; font-style: italic; font-size: 10pt></span>" )

       

      When that script step runs, it pastes this text:

       

      <SPAN STYLE=color: #3b6f99; font-style: italic; font-size: 10pt></span>

       

       

      But what I need it to paste is this:

       

       

      <SPAN STYLE="color: #3b6f99; font-style: italic; font-size: 10pt"></span>

       

      That is, I need the quotes included. OK, so you say the solution is easy, just escape the quotes like this:

       

      SetClipboardAppleScrip ( "<SPAN STYLE=\"color: #3b6f99; font-style: italic; font-size: 10pt\"></span>" )

       

      Nope - doesn't work. The version of the apple script above with the escaped quotes returns these errors:
      1. A property can't go after this """.
      2. Unknown error -2740
      How do I properly escape the needed quotes in the apple script above so that the quotes are included in text that's written to the clipboard?
      Thanks