Skip to content

Commit 6d03c4f

Browse files
committed
feat: attempt different checkbox
1 parent 3c1a807 commit 6d03c4f

File tree

2 files changed

+47
-41
lines changed

2 files changed

+47
-41
lines changed

.github/workflows/test.yml

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ jobs:
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
matrix:
16-
os: [macos-14, macos-15, macos-26, windows-2022, windows-2025]
16+
# os: [macos-14, macos-15, macos-26, windows-2022, windows-2025]
17+
os: [macos-26]
1718
steps:
1819
- uses: actions/checkout@v5
1920
- uses: actions/setup-node@v6
@@ -27,40 +28,40 @@ jobs:
2728
name: artifacts-test-${{ matrix.os }}
2829
path: |
2930
**/recordings/**/*
30-
test-ignore-tcc-db:
31-
runs-on: ${{ matrix.os }}
32-
strategy:
33-
matrix:
34-
os: [macos-14]
35-
steps:
36-
- uses: actions/checkout@v5
37-
- uses: actions/setup-node@v6
38-
with:
39-
node-version-file: .nvmrc
40-
- run: yarn install --frozen-lockfile
41-
- run: yarn ci:ignore-tcc-db
42-
- uses: actions/upload-artifact@v4
43-
if: always()
44-
with:
45-
name: artifacts-test-ignore-tcc-db-${{ matrix.os }}
46-
path: |
47-
**/recordings/**/*
48-
test-nvda-install-dir:
49-
runs-on: ${{ matrix.os }}
50-
strategy:
51-
matrix:
52-
os: [windows-2022, windows-2025]
53-
steps:
54-
- uses: actions/checkout@v5
55-
- uses: actions/setup-node@v6
56-
with:
57-
node-version-file: .nvmrc
58-
- run: yarn install --frozen-lockfile
59-
- run: yarn ci:nvda-install-dir
60-
- run: Get-ChildItem $env:USERPROFILE\nvda
61-
- uses: actions/upload-artifact@v4
62-
if: always()
63-
with:
64-
name: artifacts-test-nvda-install-dir-${{ matrix.os }}
65-
path: |
66-
**/recordings/**/*
31+
# test-ignore-tcc-db:
32+
# runs-on: ${{ matrix.os }}
33+
# strategy:
34+
# matrix:
35+
# os: [macos-14]
36+
# steps:
37+
# - uses: actions/checkout@v5
38+
# - uses: actions/setup-node@v6
39+
# with:
40+
# node-version-file: .nvmrc
41+
# - run: yarn install --frozen-lockfile
42+
# - run: yarn ci:ignore-tcc-db
43+
# - uses: actions/upload-artifact@v4
44+
# if: always()
45+
# with:
46+
# name: artifacts-test-ignore-tcc-db-${{ matrix.os }}
47+
# path: |
48+
# **/recordings/**/*
49+
# test-nvda-install-dir:
50+
# runs-on: ${{ matrix.os }}
51+
# strategy:
52+
# matrix:
53+
# os: [windows-2022, windows-2025]
54+
# steps:
55+
# - uses: actions/checkout@v5
56+
# - uses: actions/setup-node@v6
57+
# with:
58+
# node-version-file: .nvmrc
59+
# - run: yarn install --frozen-lockfile
60+
# - run: yarn ci:nvda-install-dir
61+
# - run: Get-ChildItem $env:USERPROFILE\nvda
62+
# - uses: actions/upload-artifact@v4
63+
# if: always()
64+
# with:
65+
# name: artifacts-test-nvda-install-dir-${{ matrix.os }}
66+
# path: |
67+
# **/recordings/**/*

src/macOS/enableDoNotDisturb.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,15 @@ set command to "
3737
my withTimeout(command, timeoutSeconds)
3838
`;
3939

40-
const enableFocusModeVenturaAppleScript = (locale: string) => {
40+
const enableFocusModeVenturaAppleScript = (
41+
locale: string,
42+
platformMajor: number
43+
) => {
4144
// TODO: attempt to rewrite scripts without any locale specific instructions
4245
// so this setup can be used regardless of user locale preferences.
4346
const center = locale.trim() === "en_GB" ? "Centre" : "Center";
47+
const checkboxPosition =
48+
platformMajor < 25 ? "checkbox 2 of group 1" : "checkbox 6 of group 1";
4449

4550
return `-- Startup delay to reduce chance of "Application isn't running (-600)" errors
4651
delay 1
@@ -61,7 +66,7 @@ set command to "
6166
tell its application process \\"Control ${center}\\"
6267
tell its window 1
6368
-- Check if Do Not Disturb already enabled
64-
set doNotDisturbCheckbox to checkbox 2 of group 1
69+
set doNotDisturbCheckbox to ${checkboxPosition}
6570
set doNotDisturbCheckboxStatus to value of doNotDisturbCheckbox as boolean
6671
6772
tell doNotDisturbCheckbox
@@ -101,7 +106,7 @@ export async function enableDoNotDisturb() {
101106

102107
// From MacOS 13 Ventura (Darwin 22) there is no known way to enable DND via system settings
103108
await retryOnError(() =>
104-
runAppleScript(enableFocusModeVenturaAppleScript(locale))
109+
runAppleScript(enableFocusModeVenturaAppleScript(locale, platformMajor))
105110
);
106111
}
107112
} catch (e) {

0 commit comments

Comments
 (0)