Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
applescript-utils
Advanced tools
Some utilities for working with AppleScript.
npm install applescript-utils
import { getElements } from 'applescript-utils';
await getElements('System Preferences');
Returns: ElementReference[]
Gets all the UI elements in a process. This function runs the following AppleScript:
tell application "System Events"
tell front window of process ${JSON.stringify(processName)}
get entire contents
end tell
end tell
Type: string
Required: true
The name of the process to retrieve all the elements from.
Waits until an element exists. This function runs the following AppleScript:
tell application "System Events"
tell process ${JSON.stringify(elementReference.applicationProcess)}
repeat until exists ${elementReference.pathString}
delay ${interval}
end repeat
end tell
end tell
Type: ElementReference
Required: true
A reference to the element to wait for.
Type: number
Default: 0.1
The amount of time in seconds to wait for before re-checking to see if the element exists.
Clicks an element. This function runs the following AppleScript:
tell application "System Events"
tell process ${element.applicationProcess}
set myElement to a reference to ${element.pathString}
click myElement
end tell
end tell
Type: ElementReference
Required: true
A reference to the element to click.
Toggles a checkbox element. Runs the following AppleScript:
tell application "System Events" to tell process ${props.element.applicationProcess}
set theCheckbox to ${props.element.pathString}
tell theCheckbox
${checkboxAction}
end tell
end tell
Type: ElementReference
Required: true
A reference to the checkbox element.
Type: boolean | undefined
Required: false
The value to set the checkbox. If undefined
, the checkbox will be toggled to the opposite of its current state.
Waits until an element is hidden. Runs the following AppleScript:
tell application "System Events"
tell process ${JSON.stringify(elementReference.applicationProcess)}
repeat while exists ${elementReference}
delay ${interval}
end repeat
end tell
end tell
Type: ElementReference
Required: true
A reference to the element to wait for until it's hidden.
Type: number
Default: 0.1
The amount of time to wait inbetween checks.
Waits until a matching element on the window is found.
Type: string
Required: true
The name of the window.
Type: (element: ElementReference) => boolean
Required: true
A function that takes an element reference and returns a boolean representing whether or not it matches.
Type: import('p-wait-for').Options
Required: false
Options to pass to pWaitFor
.
Input keystrokes. Runs the following AppleScript:
tell application "System Events" to keystroke ${JSON.stringify(keystrokes)}
Type: string
Required: true
The keystrokes to enter.
Returns: string | number | boolean | Record<string, unknown> | unknown[] | Date | Buffer | undefined
Runs an AppleScript string and parses the result using parse-applescript
.
Type: string
Required: true
The AppleScript code to run.
FAQs
Utilities for AppleScript scripts.
The npm package applescript-utils receives a total of 24 weekly downloads. As such, applescript-utils popularity was classified as not popular.
We found that applescript-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.