How do I download all files I have in Wolfram Cloud to my desktop?
You can use CloudObjects
and CloudDirectory
to find your files:
objects = CloudObjects @ CloudDirectory[]
{CloudObject["https://www.wolframcloud.com/obj/carlw/Base"], CloudObject[ "https://www.wolframcloud.com/obj/carlw/Copied Files"], CloudObject[ "https://www.wolframcloud.com/obj/carlw/Marathon"], CloudObject[ "https://www.wolframcloud.com/obj/carlw/Resources"], CloudObject[ "https://www.wolframcloud.com/obj/carlw/marathon"], CloudObject[ "https://www.wolframcloud.com/obj/carlw/trash"]}
Here is the first cloud object in the "Copied Files" directory:
obj = First @ CloudObjects[objects[[2]]]
CloudObject["https://www.wolframcloud.com/obj/carlw/Copied Files/01-starting-out-elementary-arithmetic-exercises.nb"]
Once you find the right directory, you can copy them with CopyFile
:
CopyFile[obj, FileNameTake @ Information[obj]["Path"]]
"/Users/carlw/Desktop/01-starting-out-elementary-arithmetic-exercises.nb"
This is the code I ended up using. It also looks into directories 1 level and copies those files too.
localBackupPath = "C:\\Users\\";
objects = CloudObjects@CloudDirectory[];
type = Information[#, "FileType"] & /@ objects;
allObjects =
Flatten[MapThread[
If[#2 === Directory, CloudObjects[#1], #1] &, {objects, type}]];
CopyFile[#,
FileNameJoin[{localBackupPath,
Information[#, "DisplayName"]}]] & /@ allObjects