Link to home
Start Free TrialLog in
Avatar of Jamie Garroch (MVP)
Jamie Garroch (MVP)Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Trouble with quoted form of path in cURL with AppleScript

This works:

do shell script "cURL -f http://mydomain/myfile.txt -o ~/Library/'Group Containers'/UBF8T346G9.Office/myFile.txt"

Open in new window

But extending the target path to include a second quoted folder fails:

do shell script "cURL -f http://mydomain/myfile.txt -o ~/Library/'Group Containers'/UBF8T346G9.Office/'User Content'/myFile.txt"

Open in new window

It raises an err:

Warning: Failed to create the file /Users/[username]/Library/Group

And in both cases, wrapping the full path in single quotes also fails at the same "Group" part of the path, eg:

do shell script "cURL -f http://mydomain/myfile.txt -o '~/Library/Group Containers/UBF8T346G9.Office/myFile.txt'"

Open in new window

What am I doing wrong?
Avatar of serialband
serialband
Flag of Ukraine image

Try just quoting the entire thing.
do shell script "cURL -f http://mydomain/myfile.txt -o '~/Library/Group Containers/UBF8T346G9.Office/User Content/myFile.txt'"

Open in new window

Avatar of Jamie Garroch (MVP)

ASKER

Thanks serialband. I did try that and also without quoting the ~/ part (bash doesn't expand it if quoted). Having tried another space delimited folder name, which worked, I then discovered the issue. The second folder "User Content" is actually "User Content.localized" which I discovered when right-clicking on it and choosing "Info". With the right folder name, single quote formats for the folder space, full folder name and full folder path (except ~/) all work as expected.
ASKER CERTIFIED SOLUTION
Avatar of Jamie Garroch (MVP)
Jamie Garroch (MVP)
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No other correct answer was provided.