Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tibi08

macrumors 6502a
Original poster
Sep 17, 2007
703
75
Brighton, UK
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?
 

tibi08

macrumors 6502a
Original poster
Sep 17, 2007
703
75
Brighton, UK
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

macrumors 6502a
Original poster
Sep 17, 2007
703
75
Brighton, UK
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.