11-19-2022, 11:32 AM
Quote:is it possible to start and end a script with the same hotkey if it's already running
static class My {
/// <summary>
/// Starts executing a script. If already running, ends that task and does not start new.
/// </summary>
/// <inheritdoc cref="script.run"/>
/// <example>
/// Trigger F11.
/// <code><![CDATA[
/// hk["F11"] = o => { My.ScriptRunOrEnd(@"\Script137.cs"); };
/// ]]></code>
/// </example>
public static void ScriptRunOrEnd(string name, params string[] args) {
if (script.end(name) == true) return;
script.run(name, args);
}
}
Quote:how do I know if a specific script is running
Next program version will have function script.isRunning.