This function sets navigation focus to object identified by DDO-ID and even opens it for input if
the second parameter is 'true' or '1'.
The second parameter can be skipped - then the object will not be opened for input.
The function throws exceptions if the parameters are not correct or if the object cannot be
found in project.
Return value is 'true' if all preconditions are met and focus change gets triggered. Even in this
case it may fail if the object is not shown on current page.
Return value is false (and nothing is triggered) if
•The object is not an input.
•A button should be opened for input.
•The object is disabled.
•An object is currently 'open for input' i.e. operator is currently changing some value.
Prototype:
var success = setFocus(number DDO-ID, bool openForInput);
Example:
//set the focus to the object with ID 93
setFocus(93, "true");
This function copies a file or directory or files or directories within the file system (including
USB stick).
The two (obligatory) parameters are the source and destination file path.
Return value is 'true' if the copy process was successful.
Return value is false if the copy process was not successful or if the parameters were invalid
or missing.
To be able to copy files into the user_files directory, it can be created using the
createUSBDirectory function.
Prototype:
var success = copyFileOrDirectory(String sourcePath, String
destinationPath);
Examples:
//copy the file test.txt from /opt to /opt/test
copyFileOrDirectory("/opt/test.txt","/opt/test/");
//copy the file test.txt from /opt to /opt/test and rename it
test2.txt
copyFileOrDirectory("/opt/test.txt","/opt/test/test2.txt");
//copy all files from /opt/test_dir1 to /opt/test_dir2
copyFileOrDirectory("/opt/test_dir1/*","/opt/test_dir2/");