Show / Hide Table of Contents

Class script

Script task functions. Run, get properties, set options, etc. A script task is a running script, except if role editorExtension. Each script task is a separate process.

public static class script

Namespace: Au
Assembly: Au.dll
Inheritance
object
script

Properties

Name Description
isDebug

Returns true if the build configuration of the main assembly is Debug (default). Returns false if Release (optimize true).

isWpfPreview

Returns true if running in WPF preview mode.

name

Gets the script name, like "Script123".

paused

If true, next call to script.pause will wait until false, or already is waiting.

role

Gets the script role (miniProgram, exeProgram or editorExtension).

testing

Returns true if this script task was started from editor with the Run button or menu command. Always false if role editorExtension.

Methods

Name Description
debug(bool)

Attaches the LibreAutomate's debugger to this process, or waits for a debugger attached to this process. Does nothing if a debugger is already attached.

end()

Ends this process.

end(int)

Ends another script process.

end(string)

Ends all task processes of a script.

isRunning(int)

Returns true if the specified script task is running.

isRunning(string)

Returns true if the specified script task is running.

pause(string, bool)

If was pressed the pause key, waits until the user presses it again.

restart(params string[])

Starts this script or program again.

run(string, params string[])

Starts executing a script. Does not wait.

runWait(Action<string>, string, params string[])

Starts executing a script, waits until the task ends and gets script.writeResult text in real time.

runWait(string, params string[])

Starts executing a script and waits until the task ends.

runWait(out string, string, params string[])

Starts executing a script, waits until the task ends and then gets script.writeResult text.

setup(bool, bool, bool, bool, UExcept, KKey, KKey, string)

Adds various features to this script task (running script): tray icon, exit on Ctrl+Alt+Delete, etc.

single(string, int, bool)

Ensures that multiple processes that call this function don't run simultaneously. Like C# lock keyword for threads.

sourcePath(bool, Assembly)

Gets path of the main source code file of this program or of a library.

sourcePath(string)

Gets path of the caller source code file.

trayIcon(int, Action<trayIcon>, Action<trayIcon, popupMenu>, string)

Adds standard tray icon.

writeResult(string)

Writes a string result for the task that called script.runWait or script.runWait to run this task, or for the program that started this task using command line like "Au.Editor.exe *Script5.cs".

See Also

process