Readonly
constantThe constant
property is a container for pre-defined constants.
Readonly
KEY_Key code for the Delete (⌫) key.
Readonly
KEY_Key code for the Down Arrow key.
Readonly
KEY_Key code for the Escape key.
Readonly
KEY_Key code for the Left Arrow key.
Readonly
KEY_Key code for the Return (↵) key.
Readonly
KEY_Key code for the Right Arrow key.
Readonly
KEY_Key code for the space bar.
Readonly
KEY_Key code for the Tab (⇥) key.
Readonly
KEY_Key code for the Up Arrow key.
Readonly
MODIFIER_Bit mask for the Command (⌘) key.
Readonly
MODIFIER_Bit mask for the Control (⌃) key.
Readonly
MODIFIER_Bit mask for the Option (⌥) key.
Readonly
MODIFIER_Bit mask for the Shift (⇧) key.
Get information about the current locale as configures in macOS settings.
Get information about the current time zone as configured in macOS settings.
Decode a Base-64 string and interpret the result as a UTF-8 string.
Accepts both standard and URL-safe variants as input. Also accepts input with or without the =
/==
end padding.
Throws an error if the input cannot be decoded as a UTF-8 string.
The decoded string
Encode a string as UTF-8 then Base-64 encode the result.
The string to encode.
Optional
options: { Optional
trimmed?: booleanWhether to trim the =
/==
padding from the string. Default is no.
Optional
urlWhether to encode using the URL-safe variant, with -
and _
substituted for +
and /
. Default is no.
Decipher a JSON object that has been lightly obscured to prevent constants such as API client identifiers appearing in plaintext in the source files.
This function will ROT13 decipher the text, apply Base64 decoding, and parse the result as JSON.
Fill the provided TypedArray
with cryptographically secure random values.
This aims work like crypto.getRandomValues()
from Web Crypto API.
Internally, it is implemented using Apple's SecRandomCopyBytes
.
The array to fill with random values. This will be modified in place.
const array = new Uint8Array(16); // array of 16 bytes
util.getRandomValues(array); // array is now filled with random bytes
Generate hash-based message authentication code (HMAC) using the supplied data, key and algorithm. Implemented internally by Apple's CommonCrypto.
Localize an English string into the current user interface language, if possible. This will work for strings which match an existing string in PopClip's user interface.
The string to localize.
The localized string, or the original string if no localized version was avaiable.
A container for various utility functions and constants util object.