1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Applescript not interpreting \" properly!

Discussion in 'Mac Programming' started by tibi08, Sep 11, 2008.

  1. macrumors 6502a


    I'm having a real problem with an Applescript.

    I am using the "Do Shell Script" command to run curl. I want to pass the string "curl "url"" to the command line - however, you can't have nested inverted commas so I assume you are meant to say "curl \"url\"". Nooo, apparently not, since Appescript then passes "curl \"url\"" to the command line rather than interpreting the \" phrase properly.

    Can anyone help me?
  2. TEG
    macrumors 604


    Use single quotes ' instead of double quotes " to wrap around either the URL or the whole string.

  3. macrumors 6502a


    Thanks - I did that at first, but there are sometimes single quotes in the URL string which prevents this from working :-(
  4. macrumors 6502a


    All fixed - for future reference, I used single inverted commas ' around the URL and replaced any apostrophes in the URL with '\\'' (the accepted form of a nested apostrophe

Share This Page