This project is read-only.

Global

Name: append
Type: function
Return type: bool
Argument 1 type: string
Argument 2 type: string

// add text to an existing data file

File.append("file.txt", "hello world");

Name: browse
Type: function
Return type: void

// open the script's data folder in File Explorer

File.browse();

Name: dataPath
Type: function
Return type: string

// returns the physical path to the data folder for this script

var path = File.dataPath();

Name: delete
Type: function
Return type: bool
Argument 1 type: string

// delete a data file

File.delete("file.txt");

Name: exists
Type: function
Return type: bool
Argument 1 type: string

// return true if a data file exists

alert(File.exists("file.txt") ? "file exists" : "file does not exist");

Name: getFiles
Type: function
Return type: array

// return an array containing all the filenames in the script's data folder

var files = File.getFiles();
alert("there are " + files.length + " files in the data folder");

Name: load
Type: function
Return type: string
Argument 1 type: string

// return the contents of a data file

var str = File.load("file.txt");
alert(str);

Name: playSound
Type: function
Return type: bool
Argument 1 type: string

// play an audio data file
File.playSound("mySound.mp3");

Name: save
Type: function
Return type: bool
Argument 1 type: string
Argument 2 type: string

// save or overwrite an existing data file

File.save("file.txt", "hello world");

Last edited May 25, 2014 at 6:58 PM by oobenoob, version 4