Namespace: misc

The misc namespace contains functions that do not fit into another category, but are not enough to have their own namespaces.

You can access this namespace via:

ashita.misc.

Below are the functions available in this namespace.


ashita.misc.open_url

Opens a url (or application) via the ShellExecute Windows API.
(Note: You should use the execute command for applications instead of open_url!)

function ashita.misc.open_url(url);

Parameters

  • url - (string) The website url (or file path) to open.

Returns

  • None

ashita.misc.play_sound

Plays a sound file (async).

function ashita.misc.play_sound(file);

Parameters

  • file - (string) The path to the file to play.

Returns

  • None

ashita.misc.get_clipboard

Returns the current clipboard text.

function ashita.misc.get_clipboard();

Parameters

  • None

Returns

  • string|nil - The clipboard text on success, nil otherwise.

ashita.misc.set_clipboard

Sets the clipboard text.

function ashita.misc.set_clipboard(text);

Parameters

  • text - (string) The text to set the clipboard to.

Returns

  • bool - True on success, false otherwise.

ashita.misc.execute

Opens an application via the ShellExecute Windows API.

function ashita.misc.execute(path, args, mode);

Parameters

  • path - (string) The path of the application to execute.
  • args - (string) The arguments to pass to the application.
  • mode - (number) The startup mode of the application. (Default: SW_SHOWMINNOACTIVE)

Returns

  • None

ashita.misc.hide_console

Hides any allocated console for the process.

function ashita.misc.hide_console();

Parameters

  • None

Returns

  • None

ashita.misc.show_console

Shows (or creates) the console for the process.

function ashita.misc.show_console();

Parameters

  • None

Returns

  • None

Note: If no console is currently allocated for the process, it will create a new one and bind the various streams to it. (CONIN$ for stdin, CONOUT$ for stdout, CONOUT$ for stderr)