folder

A variable which should be bound to a list of strings. This list of strings is used to construct an effective working directory. The list represents the hierarchy in the working directory, e.g.

:-) folder;
There is 1 result
[]
:-)
:-) folder.addLast( "parent" );
There are 0 results
:-) folder.addLast( "child" );
There are 0 results
:-) stringFile( "string.txt", "a string" );
There are 0 results
      

Note - in the text below I refer to the folders as potential folders. No folders are constructed in the script output until either a file is written or a specific request is made to create the output folder, e.g. via makeDirectory.

The first addLast call adds a potential folder to the output directory hierarchy. The second addLast call adds a potential folder inside the first potential folder. Finally the stringFile call causes the output folders to be made and a file written at the bottom of the hierarchy, e.g.

[website-folder]
  `- output
      `- parent
          `- child
              `- string.txt
      

Notes

You can assign anything you like to the folder variable, but non-lists will cause errors when you try to write files.