I am trying to output a curl command to a file in applescript but I cannot get it to output to a specific file location. The script is as follows:
set path_to_desktop to path to desktop
set posix_path to POSIX path of path_to_desktop & "quotes.csv" as text
do shell script "curl " & "http://finance.yahoo.com/d/quotes.csv?s=IBM,DELL,DIA,QQQQ,AAPL&f=sl1d1t1c1ohgv" & "-o " & quoted form of posix_path
I can run the curl command in terminal and it outputs to the file but cannot get it to work in applescript. I have tried various form of the path to no avail. It seems to fall over as the path has a directory called “Network Data” and the curl output command does not seem to like the space in that directory.
Any help would be appreciated.