Import my scripts from Cloud to open with Mathematica?

After discovering the time limitation on doing integrations on the cloud, I purchased Mathematica. However, although I can open from the cloud, I can’t find an option to import my cloud scripts to Mathematica desktop so I can run without the cloud. Where is it?

Hi James,

You can manually download each cloud notebook by selecting Download from the File menu. This is tedious if you have a lot of notebooks. I wrote a function to download all cloud notebooks. It only handles two levels of sub-directories. Fairly straightforward to extend if you have more.

cloudToLocal[localBase_] := 
 Module[{objects, types, allObjects, allPaths, directories},
  PrintTemporary["Getting list of top level objects"];
  objects = CloudObjects@CloudDirectory[];
  PrintTemporary["Getting top level object types"];
  types = Information[#, "FileType"] & /@ objects;
  PrintTemporary["Getting list of second level objects"];
  allObjects = 
   Flatten[
    MapThread[
     If[#2 === Directory, CloudObjects[#1], #1] &, {objects, 
      types}]];
  PrintTemporary["Getting paths"];
  allPaths = Information[#, "Path"] & /@ allObjects;
  directories = 
   FileNameTake[#, {1, -2}] & /@ allPaths // DeleteDuplicates;
  CreateDirectory@FileNameJoin@{localBase, #} & /@ directories;
  PrintTemporary[
   "Copying " <> ToString[Length@allObjects] <> " files"];
  MapThread[
   CopyFile[#1, FileNameJoin@{localBase, #2}] &, {allObjects, 
    allPaths}];
  ]

To use it e.g.

cloudToLocal["~/Documents/Wolfram/CloudBackup"]

Depending on the number of cloud files you have it can take a while for the copy to complete.

For a single cloud file you can use the cloud menu option File/Download. And then open that file in Mathematica Desktop,