Skip to content

readFile()

Description

The readFile() function is used to read from a file.

Syntax

JS
readFile(path: String) -> String

Parameters

Parameter Type Description
path String The script file path. Can be absolute or relative (relative to <path_MotorXP-AFM>/bin/assets/scripts).

Return value

Type Description
String The content of the file.

Example

JS
let content = readFile("c:/temp/sample.txt");
console.info(content);

See Also

writeFile()

Last update: 14 August 2025, 18:47