From 6d03c4fa996f653328a38e3833da71a6feb60919 Mon Sep 17 00:00:00 2001 From: cmorten Date: Sat, 15 Nov 2025 18:20:19 +0000 Subject: [PATCH 1/5] feat: attempt different checkbox --- .github/workflows/test.yml | 77 +++++++++++++++++---------------- src/macOS/enableDoNotDisturb.ts | 11 +++-- 2 files changed, 47 insertions(+), 41 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ab27f3b..ae487d5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-14, macos-15, macos-26, windows-2022, windows-2025] + # os: [macos-14, macos-15, macos-26, windows-2022, windows-2025] + os: [macos-26] steps: - uses: actions/checkout@v5 - uses: actions/setup-node@v6 @@ -27,40 +28,40 @@ jobs: name: artifacts-test-${{ matrix.os }} path: | **/recordings/**/* - test-ignore-tcc-db: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-14] - steps: - - uses: actions/checkout@v5 - - uses: actions/setup-node@v6 - with: - node-version-file: .nvmrc - - run: yarn install --frozen-lockfile - - run: yarn ci:ignore-tcc-db - - uses: actions/upload-artifact@v4 - if: always() - with: - name: artifacts-test-ignore-tcc-db-${{ matrix.os }} - path: | - **/recordings/**/* - test-nvda-install-dir: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-2022, windows-2025] - steps: - - uses: actions/checkout@v5 - - uses: actions/setup-node@v6 - with: - node-version-file: .nvmrc - - run: yarn install --frozen-lockfile - - run: yarn ci:nvda-install-dir - - run: Get-ChildItem $env:USERPROFILE\nvda - - uses: actions/upload-artifact@v4 - if: always() - with: - name: artifacts-test-nvda-install-dir-${{ matrix.os }} - path: | - **/recordings/**/* + # test-ignore-tcc-db: + # runs-on: ${{ matrix.os }} + # strategy: + # matrix: + # os: [macos-14] + # steps: + # - uses: actions/checkout@v5 + # - uses: actions/setup-node@v6 + # with: + # node-version-file: .nvmrc + # - run: yarn install --frozen-lockfile + # - run: yarn ci:ignore-tcc-db + # - uses: actions/upload-artifact@v4 + # if: always() + # with: + # name: artifacts-test-ignore-tcc-db-${{ matrix.os }} + # path: | + # **/recordings/**/* + # test-nvda-install-dir: + # runs-on: ${{ matrix.os }} + # strategy: + # matrix: + # os: [windows-2022, windows-2025] + # steps: + # - uses: actions/checkout@v5 + # - uses: actions/setup-node@v6 + # with: + # node-version-file: .nvmrc + # - run: yarn install --frozen-lockfile + # - run: yarn ci:nvda-install-dir + # - run: Get-ChildItem $env:USERPROFILE\nvda + # - uses: actions/upload-artifact@v4 + # if: always() + # with: + # name: artifacts-test-nvda-install-dir-${{ matrix.os }} + # path: | + # **/recordings/**/* diff --git a/src/macOS/enableDoNotDisturb.ts b/src/macOS/enableDoNotDisturb.ts index 97ade93..7f766fc 100644 --- a/src/macOS/enableDoNotDisturb.ts +++ b/src/macOS/enableDoNotDisturb.ts @@ -37,10 +37,15 @@ set command to " my withTimeout(command, timeoutSeconds) `; -const enableFocusModeVenturaAppleScript = (locale: string) => { +const enableFocusModeVenturaAppleScript = ( + locale: string, + platformMajor: number +) => { // TODO: attempt to rewrite scripts without any locale specific instructions // so this setup can be used regardless of user locale preferences. const center = locale.trim() === "en_GB" ? "Centre" : "Center"; + const checkboxPosition = + platformMajor < 25 ? "checkbox 2 of group 1" : "checkbox 6 of group 1"; return `-- Startup delay to reduce chance of "Application isn't running (-600)" errors delay 1 @@ -61,7 +66,7 @@ set command to " tell its application process \\"Control ${center}\\" tell its window 1 -- Check if Do Not Disturb already enabled - set doNotDisturbCheckbox to checkbox 2 of group 1 + set doNotDisturbCheckbox to ${checkboxPosition} set doNotDisturbCheckboxStatus to value of doNotDisturbCheckbox as boolean tell doNotDisturbCheckbox @@ -101,7 +106,7 @@ export async function enableDoNotDisturb() { // From MacOS 13 Ventura (Darwin 22) there is no known way to enable DND via system settings await retryOnError(() => - runAppleScript(enableFocusModeVenturaAppleScript(locale)) + runAppleScript(enableFocusModeVenturaAppleScript(locale, platformMajor)) ); } } catch (e) { From 73f0f082a14f3b70d34d71a658c28b9d1ad9fef1 Mon Sep 17 00:00:00 2001 From: cmorten Date: Sun, 16 Nov 2025 17:50:35 +0000 Subject: [PATCH 2/5] feat: checkbox 7 --- src/macOS/enableDoNotDisturb.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/macOS/enableDoNotDisturb.ts b/src/macOS/enableDoNotDisturb.ts index 7f766fc..ff44f4a 100644 --- a/src/macOS/enableDoNotDisturb.ts +++ b/src/macOS/enableDoNotDisturb.ts @@ -45,7 +45,7 @@ const enableFocusModeVenturaAppleScript = ( // so this setup can be used regardless of user locale preferences. const center = locale.trim() === "en_GB" ? "Centre" : "Center"; const checkboxPosition = - platformMajor < 25 ? "checkbox 2 of group 1" : "checkbox 6 of group 1"; + platformMajor < 25 ? "checkbox 2 of group 1" : "checkbox 7 of group 1"; return `-- Startup delay to reduce chance of "Application isn't running (-600)" errors delay 1 From 4ff47c46282eaf2f438e2e202ecd693cb28dfe3e Mon Sep 17 00:00:00 2001 From: cmorten Date: Sun, 16 Nov 2025 17:52:49 +0000 Subject: [PATCH 3/5] feat: more delays --- src/macOS/enableDoNotDisturb.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/macOS/enableDoNotDisturb.ts b/src/macOS/enableDoNotDisturb.ts index ff44f4a..5b82dd1 100644 --- a/src/macOS/enableDoNotDisturb.ts +++ b/src/macOS/enableDoNotDisturb.ts @@ -57,9 +57,10 @@ set command to " tell application \\"System Events\\" key down 63 key down \\"c\\" - delay 0.5 + delay 1 key up \\"c\\" key up 63 + delay 1 end tell tell application \\"System Events\\" @@ -71,7 +72,7 @@ set command to " tell doNotDisturbCheckbox if doNotDisturbCheckboxStatus is false then - perform action 1 of doNotDisturbCheckbox + click doNotDisturbCheckbox end if end tell end tell From f937ce22c958d59b8606f052a147d83aa0f8030b Mon Sep 17 00:00:00 2001 From: cmorten Date: Sun, 16 Nov 2025 17:55:54 +0000 Subject: [PATCH 4/5] feat: couple more delays --- src/macOS/enableDoNotDisturb.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/macOS/enableDoNotDisturb.ts b/src/macOS/enableDoNotDisturb.ts index 5b82dd1..676d654 100644 --- a/src/macOS/enableDoNotDisturb.ts +++ b/src/macOS/enableDoNotDisturb.ts @@ -60,7 +60,7 @@ set command to " delay 1 key up \\"c\\" key up 63 - delay 1 + delay 2 end tell tell application \\"System Events\\" @@ -79,13 +79,16 @@ set command to " end tell end tell + delay 2 + -- Close Control Center drop down tell application \\"System Events\\" key down 63 key down \\"c\\" - delay 0.5 + delay 1 key up \\"c\\" key up 63 + delay 2 end tell " From f32b3e89fd829d8aee7b8024f78fa9ac524a7d0a Mon Sep 17 00:00:00 2001 From: cmorten Date: Sun, 16 Nov 2025 18:09:49 +0000 Subject: [PATCH 5/5] revert: put all os back --- .github/workflows/test.yml | 77 +++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ae487d5..ab27f3b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,8 +13,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - # os: [macos-14, macos-15, macos-26, windows-2022, windows-2025] - os: [macos-26] + os: [macos-14, macos-15, macos-26, windows-2022, windows-2025] steps: - uses: actions/checkout@v5 - uses: actions/setup-node@v6 @@ -28,40 +27,40 @@ jobs: name: artifacts-test-${{ matrix.os }} path: | **/recordings/**/* - # test-ignore-tcc-db: - # runs-on: ${{ matrix.os }} - # strategy: - # matrix: - # os: [macos-14] - # steps: - # - uses: actions/checkout@v5 - # - uses: actions/setup-node@v6 - # with: - # node-version-file: .nvmrc - # - run: yarn install --frozen-lockfile - # - run: yarn ci:ignore-tcc-db - # - uses: actions/upload-artifact@v4 - # if: always() - # with: - # name: artifacts-test-ignore-tcc-db-${{ matrix.os }} - # path: | - # **/recordings/**/* - # test-nvda-install-dir: - # runs-on: ${{ matrix.os }} - # strategy: - # matrix: - # os: [windows-2022, windows-2025] - # steps: - # - uses: actions/checkout@v5 - # - uses: actions/setup-node@v6 - # with: - # node-version-file: .nvmrc - # - run: yarn install --frozen-lockfile - # - run: yarn ci:nvda-install-dir - # - run: Get-ChildItem $env:USERPROFILE\nvda - # - uses: actions/upload-artifact@v4 - # if: always() - # with: - # name: artifacts-test-nvda-install-dir-${{ matrix.os }} - # path: | - # **/recordings/**/* + test-ignore-tcc-db: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-14] + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-node@v6 + with: + node-version-file: .nvmrc + - run: yarn install --frozen-lockfile + - run: yarn ci:ignore-tcc-db + - uses: actions/upload-artifact@v4 + if: always() + with: + name: artifacts-test-ignore-tcc-db-${{ matrix.os }} + path: | + **/recordings/**/* + test-nvda-install-dir: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-2022, windows-2025] + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-node@v6 + with: + node-version-file: .nvmrc + - run: yarn install --frozen-lockfile + - run: yarn ci:nvda-install-dir + - run: Get-ChildItem $env:USERPROFILE\nvda + - uses: actions/upload-artifact@v4 + if: always() + with: + name: artifacts-test-nvda-install-dir-${{ matrix.os }} + path: | + **/recordings/**/*