folder([folderPath])

Returns a folder object. Note that the resulting folder object can either refer to an already existing folder or if the folder does not exist, it can create a preliminary “virtual” folder that refers to a folder that could be created later.

Type: function

Parameter(s):

  • folderPath {String} Optional:

    The path of the folder.

Returns:

  • {Folder}:

    Folder at the given path. If no path is given, but the document is already saved, the document’s data folder will be returned.

Example(s):

Get a folder from the desktop and load its files

var myImageFolder = folder("~/Desktop/myImages/");
var myImageFiles = files(myImageFolder);

Get the data folder, if the document is already saved

var myDataFolder = folder();