App object
Is a collection of different functions (tools) that your program can use for various task. These tasks include reading files, gathering info about the computer’s CPU, checking how much memory is available, choosing files and many more.
-- an example of how to access various functions from the app object
local processor = app.getProcessorName()
- isIDE()
Returns whether the app is being run in
Limer
or as executable
- joinPaths(...)
Joins multiple paths into one
- randomChoice(table)
Randomly selects a string from a table
- getStandardPath(location)
A set of standard locations on a user’s system where different types of files or resources are commonly stored. These locations are predefined and provide a consistent way to access specific directories such as user’s documents, desktop, applications, and more across different platform. Available arguments for
location
parameter include:desktop
,documents
,fonts
,applications
,music
,movies
,pictures
,temp
,home
,applocaldata
,cache
,genericdata
,runtime
,config
,download
,genericcache
,genericconfig
,appdata
,appconfig
,publicshare
,templates
-- how to get the location for desktop local desktop = app.getStandardPath('desktop')
- splitString(string, delimeter)
Split the string by the delimite
- intRange(from, to)
Returns a table with a ranger of integers
- sleep(seconds)
Sleep for some time. Use
1, 2, 3, ...
and not1000, 2000
to represent time
- weightedGraph(data, startNode, endNode)
Perfoms a weighted graph algorithm on data.
-- Based on the provided data, calculates shortest path from point a to point c local graph = app.weightedGraph({{'point a', 'point b', 20}, {'point a', 'point c', 10}, {'point b', 'point c', 50}}, 'point a', 'point c')
- getStyles()
Returns platform-dependent UI styles that can be applies to the whole application.
- setStyle(style)
Set the style to the whole application. Obtained from the above function
- makeHash(hashType, string)
Generate a hash from the
string
based on the hash-type provided: Available hash types:md5
,sha1
,sha224
,sha256
,sha384
,sha512
,sha3_224
,sha3_256
,sha3_384
,sha3_512
- hexToRGB(hex)
Converts a hex to RGB values
- readFileLines(file)
Reads the file lines for a particular file
- bytesToReadableSize(bytes)
Converts bytes to readable size, ie,
2 kb, 10 GB
- toBase64(string)
Converts string to base64 encoding
- fromBase64(b64)
Converts base64 string to readable string
- setFont(file, textSize)
Sets the font and text size for the whole application
- extractZip(zip, destination)
Extracts the content of a zip file to some destination
- isFolder(path)
Checks if given path is a folder or not
- exists(path)
Checks if given path is empty or not
- isFolderEmpty(path)
Checks if a given path is an exmpty dir or not
- isFileEmpty(file)
Checks if a given file is exmpty or not
- getFileSize(file)
Returns file size
- getFileExt(file)
Returns only the file extension for a file path
- copyFile(source, destination)
Copies a file from source to destination
- readFile(file)
Reads a file and returns its content
- writeFile(file, content)
Write content to a file
- appendFile(file, content)
Does not overwrite, only appeands content to the file
- quit()
Quits the application
- setClipboardText(text)
Sets text to the clipboard
- getClipboardText()
Returns text from the clipboard
- listFolder(path)
Returns a list of files in a folder
- renameFile(file, newName)
Renames a file
- renameFolder(path, newName)
Renames a folder
- createFolder(path)
Creates a new folder
- playSound(file)
Plays any audio format
- getProcesses()
Returns a list for running processes
- killProcess(pid)
Kills/terminates a running process by a pid (Process Identifier)
- getUsers()
Returns available users on a system
- getCPUCount()
Returns the number of CPUs available
- getBatteryInfo()
Returns available battery info
- getDiskPartitions()
Returns available partitions in a system
- getDiskInfo(path)
Returns disk info.
path
can obtained from above method, ie,C:\\
,D:\\
,E:\\
- getBootTime()
Returns the system’s boot time
- getMachineType()
Returns the machine type, ie,
AMD64
- getNetworkNodeName()
Returns the network node name
- getProcessorName()
Returns the processor info
- getPlatformName()
Returns the platform name, ie,
Windows-10-10.0.22621-SP0
- getSystemRelease()
Returns the OS’s release
- getOSName()
Returns the OS’s name, ie,
Windows
- getOSVersion()
Returns available users on a system