PDA

View Full Version : Applescript not interpreting \" properly!




tibi08
Sep 11, 2008, 01:29 PM
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?



TEG
Sep 11, 2008, 01:38 PM
Use single quotes ' instead of double quotes " to wrap around either the URL or the whole string.

TEG

tibi08
Sep 11, 2008, 01:39 PM
Use single quotes ' instead of double quotes " to wrap around either the URL or the whole string.

TEG

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

tibi08
Sep 11, 2008, 01:58 PM
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