Thanks.
@Airy I do not have any read-only file systems.
@peternlewis Interesting. Before posting, I did try changing the ~ to the full path, and wasn't able to get it to work.
But now I tried a few more variations and was able to get it to work IF there are no spaces in the path. It seems that even escaping spaces with a backslash is problematic and gives a "failed to extract a sensible file name from the URL to use for storage" error.
And also when I use a path with an escaped space and the "Include Errors" flag on, it looks like it returns the "raw data" of the image it's trying to download.
e.g. if I try the macro on this page, here's part of the results...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: Downloads
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 7134 100 7134 0 0 171k 0 --:--:-- --:--:-- --:--:-- 174k
PNG
IHDR@@ªiqÞe¥IDATxÚÍ{ çuÞûû{fwv±÷û^Jâ7h"HB$HÚ²ãË*ªDª¤¬,0Êv%1§G¦bÚ%J@%´$@H n,ÅâØû¾ç¾ûÏû{föÂb± ltOOwOß{ï{ßÿ÷,¡Âx|·wíÚE:÷Óâçßÿþ÷»ø_ä³"f@Ö´!ñH#§¯q)øÃDII$îIyáX#hR5[î~qu5@ýÆO.É°µ m"ÝÐÐ
My path was /Users/myusername/desktop\ Downloads
And from "Could not resolve host: Downloads", it looks like the shell interpreted the "Downloads" part of the path as part of the url. I guess the shell is stripping or ignoring the backslash.
Also, I ended up tweaking the macro so the variable only contains the path and url to download, and changed the shell script to: curl --create-dirs -O -J --output-dir $KMVAR_local_curlString
@johns I'm not familiar with eval, but after Googling, this is the proper usage, right?
variable="$KMVAR_local_curlString"
eval "$variable"
I wasn't able to get that to work.