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:

program string args object[]


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:

program string args object[]

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


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:

path string options printoptions (optional)


setClipboardContent(text)

Set clipboard text.

@param {string} text to be set in clipboard

Parameters:

text string


showExternal(url)

Manage URLs using their default applications

@param {String} url

Parameters:

url string


Types

printer

scripting type: CustomType<ngdesktoputils.printer>

printoptions

scripting type: CustomType<ngdesktoputils.printoptions>

sysinfo

scripting type: CustomType<ngdesktoputils.sysinfo>


Last updated