functions for directories/files

util.createDirectory("DirectoryPath");
creates a directory by the defined path
util.createDirectory("D:/Test/Folder");

util.directoryExists("DirectoryPath");
returned 1 if directory exist or 0 if not
util.directoryExists("D:/Test/Folder");

util.fileExists("FilePath");
returned 1 if file exist or 0 if not
util.fileExists("C:/Program Files/Stage Precision/Stage Precision.exe");

util.readFile("FileName");
returned the content of a *.txt file
util.readFile("C:/Log.txt");

util.readDirectory("DirectoryPath");
returned all files within the given path as array
util.readDirectory("C:/");

util.renameFile("FilePath", "newName");
renamed the defined file
util.renameFile("D:/Test.txt", "NewText.txt");

util.writeFile("Path/File", "content");
writes a file on the given path with the given content
util.writeFile("D:/Test/Test.txt", "Some content for this file");

start/kill applications/files

util.killApp("AppName");
close the defined application
util.killApp("mspaint.exe");

util.launchFile("Path/FileName");
opens the defined file/application
util.launchFile("C:/Users/Test/Pictures/Image.png");

functions for strings

util.StringContainsAnyOf("string", "chars");
returned 1 if a single given char is part of the given string 0 if not
util.StringContainsAnyOf("Test", "T"); will return a 1 because "T" is part of "Test"
util.StringContainsAnyOf("Test", "Begin"); will also return a 1 because the "e" of "Begin" is part of "Test"
util.StringContainsAnyOf("Test", "Ping"); will return a 0 because there are no matching characters

util.StringContainsLowerCase("string");
returned 1 if a single given char is a lower case character, 0 if not
util.StringContainsLowerCase("TEST"); will return a 0
util.StringContainsLowerCase("TeST"); will return a 1

util.StringContainsOnly("string", "chars");
returned 1 if the given char is equal to the string (case sensitive), 0 if not
util.StringContainsOnly("Test 123", "Test 123"); will return a 1
util.StringContainsOnly("Test 123", "Test"); will return a 0
util.StringContainsOnly("Test 123", "test 123"); will return a 0

util.StringContainsUpperCase("string");
returned 1 if a single given char is a upper case character, 0 if not
util.StringContainsUpperCase("Test"); will return a 1
util.StringContainsUpperCase("test"); will return a 0

util.StringContainsWholeWord("string", "word");
returned 1 if the given word is is part of the given string (case sensitive), 0 if not
util.StringContainsWholeWord("Test 123", "123"); will return a 1
util.StringContainsWholeWord("Test 123", "Test"); will also return a 1
util.StringContainsWholeWord("Test 123", "1234"); will return a 0
util.StringContainsWholeWord("Test 123", "test"); will return a 0

util.StringContainsWholeWordIgnoreCase("string", "word");
returned 1 if the given word is is part of the given string (not case sensitive), 0 if not
util.StringContainsWholeWordIgnoreCase("Test 123", "123"); will return a 1
util.StringContainsWholeWordIgnoreCase("Test 123", "test"); will also return a 1
util.StringContainsWholeWordIgnoreCase("Test 123", "1234"); will return a 0

util.StringToLowerCase("string");
returned the given string with lower case only
util.StringToLowerCase("TEst TesT"); will return "test test"

util.StringToUpperCase("string");
returned the given string with upper case only
util.StringToUpperCase("Test Test"); will return "TEST TEST"

system functions

util.copyToClipboard("value");
copy the defined value into the clipboard

util.getFromClipboard();
returned the content of the clipboard

util.getAppVersion();
returned the Stage Precision version number

util.getIPs();
returned an array with all avaiable IP addresses

util.getObjectMethods(Object);
returned an array with all avaiable methods from the given object

util.getObjectProperties(Object);
returned an array with all avaiable properties from the given object

util.getOSInfos();
returned a Object witch needs addional “extensions” to acces the data
util.getOSInfos().name to get the os-name
util.getOSInfos().type to get the os-type
util.getOSInfos().computerName to get the system computer name
util.getOSInfos().language to get the os-language code
util.getOSInfos().username to get the system user name

util.getTime();
returned the number of seconds since the last system boot

util.getTimestamp();
returned the number of seconds since January 1, 1970 (midnight UTC/GMT)

convert functions

util.getFloatFromBytes(ByteArray);
returned a float from a given byte array
util.getFloatFromBytes(80,65,78,65,74)

util.getInt32FromBytes(ByteArray);
returned a 32bit integer from a given byte array
util.getInt32FromBytes(80,65,78,65,74)

util.getInt64FromBytes(ByteArray);
returned a 64bit integer from a given byte array
util.getInt64FromBytes(80,65,78,65,74)

dialog/message boxes

util.showMessageBox("title", "message");
generates a message box
util.showMessageBox("title", "message", "optionalType");
the box type can be changed (optional)


util.showMessageBox("This is a message box", "with some information");


util.showMessageBox("This is a message box", "with some information", "warning");


util.showMessageBox("This is a message box", "with some information", "info");


util.showMessageBox("This is a message box", "with some information", "question");

util.showOkCancelBox("title", "message");
generates a message box with two options
the first options returned 1, the second option 0
util.showOkCancelBox("title", "message", "optionalType", "optionalLabelOK", "optionalLabelCancel");
the box type can be changed as well as the button labels (optional)


util.showOkCancelBox("This is a message box", "with a question");


util.showOkCancelBox("This is a message box", "with a question", "warning", "Yes", "No");


util.showOkCancelBox("This is a message box", "with a question", "info", "Yes", "No");


util.showOkCancelBox("This is a message box", "with a question", "question", "Yes", "No");

util.showPasswordBox("title", "message");
generates a message box with a password field
returned the password as string
util.showPasswordBox("title", "message", "optionalType");
the box type can be changed (optional)


util.showPasswordBox("This is a message box", "a password is needed");


util.showPasswordBox("This is a message box", "a password is needed", "warning");


util.showPasswordBox("This is a message box", "a password is needed", "info");


util.showPasswordBox("This is a message box", "a password is needed", "question");

util.showOkCancelBox("title", "message", "optionalType", "optionalLabelOK", "optionalLabelCancel");
the box type can be changed as well as the button labels (optional)

util.showYesNoCancelBox("title", "message");
generates a message box with three options
the first options returned 1, the second option 2, the third option 0
util.showYesNoCancelBox("title", "message", "optionalType", "optionalLabelYes", "optionalLabelNo", "optionalLabelCancel");
the box type can be changed as well as the button labels (optional)


util.showPasswordBox("This is a message box", "with three options");


util.showPasswordBox("This is a message box", "with three options", "warning", "One", "Two", "Three");


util.showPasswordBox("This is a message box", "with three options", "info", "One", "Two", "Three");


util.showPasswordBox("This is a message box", "with three options", "question", "One", "Two", "Three");