NGDesktop Utils (ref)

(part of package 'NGDesktop Utils')

You can access it in code via: plugins.ngdesktoputils

API

executeCommand(program,args)

Executes a command async, the server side call will not block on this call.

Parameters:


executeCommandSync(program,args)

This executes a command and returns the result of the stdout This will also call reject when a error happens so the call will error out. (will not return correct) Try to use the async executeCommand so nothing will be blocking.

Parameters:

Returns: string


exit()

This will close the NGDesktop main application. Be sure you will call this and after this call application.exit() to close also the client directly itself.


getClipboardContent()

Get clipboard text.

Returns: string


getDefaultPrinter()

Returns default printer on local machine.

Returns: printer


getPrinters()

Returns installed printers on local machine.

Returns: printer[]


getSystemInformation()

Retrieve information from the ngdesktop client

@return

an object containing the client's system information:

    ngDesktopVersion    - string: ngdesktop version
    osPlatform          - string: can be 'darwin', 'linux', 'freebsd', 'openbsd' and 'win32'
    osRelease           - string: kernel release number
    osTotalMem          - long: total system's memory
    osFreeMem           - long: total available memory

Returns: sysinfo **an object containing the client's system information:ngDesktopVersion - string: ngdesktop versionosPlatform - string: can be 'darwin', 'linux', 'freebsd', 'openbsd' and 'win32'osRelease - string: kernel release numberosTotalMem - long: total system's memoryosFreeMem - long: total available memory


isNGDesktop()

Whether application is running as NGDesktop.

Returns: boolean


printPDF(path,options )

Prints a pdf document specified by path. Optionally, specify printer or unix print options (lp command) or windows print options see: https://github.com/Servoy/pdf-to-printer

Parameters:


setClipboardContent(text)

Set clipboard text.

Parameters:

  • {string} text Text to be set in clipboard


showExternal(url)

Manage URLs using their default applications

Parameters:


Types

printer

scripting type: CustomType<ngdesktoputils.printer>

printoptions

scripting type: CustomType<ngdesktoputils.printoptions>

sysinfo

scripting type: CustomType<ngdesktoputils.sysinfo>


Last updated