From 7335aba81b766a1325e8b233b06f24ff398ec929 Mon Sep 17 00:00:00 2001 From: Tyce Herrman Date: Thu, 30 Jul 2026 10:10:24 -0400 Subject: [PATCH 1/2] runAppleScript: report effective timeout in errors --- docs/utils-reference/getting-started.md | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- src/run-applescript.ts | 5 +++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/utils-reference/getting-started.md b/docs/utils-reference/getting-started.md index 2716a76..e3b3ea0 100644 --- a/docs/utils-reference/getting-started.md +++ b/docs/utils-reference/getting-started.md @@ -16,6 +16,10 @@ npm install --save @raycast/utils ## Changelog +### v2.2.7 + +- Fixed `runAppleScript` timeout error messages reporting `undefined` instead of the effective timeout. + ### v2.2.6 - Fixed an issue where refreshing OAuth tokens would fails for providers that return scope as an array instead of a string diff --git a/package-lock.json b/package-lock.json index 20a0681..440070f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@raycast/utils", - "version": "2.2.6", + "version": "2.2.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@raycast/utils", - "version": "2.2.6", + "version": "2.2.7", "license": "MIT", "dependencies": { "dequal": "^2.0.3" diff --git a/package.json b/package.json index b0410d2..526cb8c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@raycast/utils", - "version": "2.2.6", + "version": "2.2.7", "description": "Set of utilities to streamline building Raycast extensions", "author": "Raycast Technologies Ltd.", "homepage": "https://developers.raycast.com/utilities/getting-started", diff --git a/src/run-applescript.ts b/src/run-applescript.ts index 59f66ab..109a72c 100644 --- a/src/run-applescript.ts +++ b/src/run-applescript.ts @@ -103,7 +103,8 @@ export async function runAppleScript( ...execOptions, env: { PATH: "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" }, }); - const spawnedPromise = getSpawnedPromise(spawned, { timeout: timeout ?? 10000 }); + const effectiveTimeout = timeout ?? 10000; + const spawnedPromise = getSpawnedPromise(spawned, { timeout: effectiveTimeout }); spawned.stdin.end(script); @@ -123,7 +124,7 @@ export async function runAppleScript( signal, timedOut, command: "osascript", - options, + options: { timeout: effectiveTimeout }, parentError: new Error(), }); } From 5cdb716a28514beea56ba74147d6ddc4ef099593 Mon Sep 17 00:00:00 2001 From: Mathieu Dutour Date: Tue, 4 Aug 2026 17:38:00 +0200 Subject: [PATCH 2/2] Refactor options in osascript execution --- src/run-applescript.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/run-applescript.ts b/src/run-applescript.ts index 109a72c..b86b7e8 100644 --- a/src/run-applescript.ts +++ b/src/run-applescript.ts @@ -124,7 +124,12 @@ export async function runAppleScript( signal, timedOut, command: "osascript", - options: { timeout: effectiveTimeout }, + options: { + humanReadableOutput, + language, + timeout: effectiveTimeout, + ...execOptions, + }, parentError: new Error(), }); }