applescript-utils
Advanced tools
Comparing version 0.1.14 to 0.1.15
export type { ElementPathPart } from './types/element.js'; | ||
export { toggleCheckbox } from './utils/checkbox.js'; | ||
export { clickElement, createBaseElementReference, createElementReferences, getElements, waitForElementExists, waitForElementHidden, waitForElementMatch, } from './utils/element.js'; | ||
export { clickElement } from './utils/click.js'; | ||
export { createBaseElementReference, createElementReferences, getElementProperties, getElements, waitForElementExists, waitForElementHidden, waitForElementMatch, } from './utils/element.js'; | ||
export { BaseElementReference, ElementReference, } from './utils/element-reference.js'; | ||
@@ -5,0 +6,0 @@ export { inputKeystrokes } from './utils/keystroke.js'; |
export { toggleCheckbox } from './utils/checkbox.js'; | ||
export { clickElement, createBaseElementReference, createElementReferences, getElements, waitForElementExists, waitForElementHidden, waitForElementMatch, } from './utils/element.js'; | ||
export { clickElement } from './utils/click.js'; | ||
export { createBaseElementReference, createElementReferences, getElementProperties, getElements, waitForElementExists, waitForElementHidden, waitForElementMatch, } from './utils/element.js'; | ||
export { BaseElementReference, ElementReference, } from './utils/element-reference.js'; | ||
@@ -4,0 +5,0 @@ export { inputKeystrokes } from './utils/keystroke.js'; |
{ | ||
"name": "applescript-utils", | ||
"version": "0.1.14", | ||
"version": "0.1.15", | ||
"description": "Utilities for AppleScript scripts.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -5,3 +5,2 @@ import type { Options as PWaitForOptions } from 'p-wait-for'; | ||
export declare function getElements(processName: string): Promise<ElementReference[]>; | ||
export declare function clickElement(element: BaseElementReference): Promise<void>; | ||
export declare function createBaseElementReference(elementPathString: string): BaseElementReference; | ||
@@ -20,2 +19,3 @@ export declare function createElementReferences(elementPathStrings: string[]): ElementReference[]; | ||
export declare function waitForElementMatch(windowName: string, elementMatcher: (element: ElementReference) => boolean, pWaitForOptions?: PWaitForOptions): Promise<ElementReference>; | ||
export declare function getElementProperties(element: BaseElementReference): Promise<Record<string, unknown>>; | ||
export {}; |
@@ -16,12 +16,2 @@ import { outdent } from 'outdent'; | ||
} | ||
export async function clickElement(element) { | ||
await runAppleScript(outdent ` | ||
tell application "System Events" | ||
tell process ${JSON.stringify(element.applicationProcess)} | ||
set myElement to a reference to ${element.pathString} | ||
click myElement | ||
end tell | ||
end tell | ||
`); | ||
} | ||
export function createBaseElementReference(elementPathString) { | ||
@@ -78,1 +68,11 @@ const pathParts = pathStringToPathParts(elementPathString); | ||
} | ||
export async function getElementProperties(element) { | ||
const properties = (await runAppleScript(outdent ` | ||
tell application "System Events" | ||
tell process ${JSON.stringify(element.applicationProcess)} | ||
get properties of ${element.pathString} | ||
end tell | ||
end tell | ||
`)); | ||
return properties; | ||
} |
import { outdent } from 'outdent'; | ||
import { toggleCheckbox } from '../utils/checkbox.js'; | ||
import { clickElement, createElementReferences, getElements, waitForElementExists, waitForElementHidden, waitForElementMatch, } from '../utils/element.js'; | ||
import { clickElement } from '../utils/click.js'; | ||
import { createElementReferences, getElements, waitForElementExists, waitForElementHidden, waitForElementMatch, } from '../utils/element.js'; | ||
import { runAppleScript } from '../utils/run.js'; | ||
@@ -5,0 +6,0 @@ import { waitForWindow } from '../utils/window.js'; |
Sorry, the diff of this file is not supported yet
101742
33
2838