bagre
March 11, 2026, 9:15pm
1
Hello! Just bought the perpetual license, but I can’t make a touch button work with shortcuts because the shortcut list is empty:
Tried removing and re-adding all permissions from Automation section, but it didn’t work:
When I click the favorite action “Run shortcuts from the Shortcut app”, the app crashes (see attached log):
crash.txt (54.9 KB)
Using last alpha version (6.244) on macOS 26.3.
Thanks.
can you try running this script in the macOS script editor and tell me whether it outputs an error?
s = Application("Shortcuts Events");
function listAll() {
let array = [];
try {
for (let folder of s.folders()) {
try {
for (let shortcut of folder.shortcuts()) {
try {
array.push({
name: shortcut.name(),
color: shortcut.color(),
folder: folder.name(),
});
} catch (e) {
array.push({
name: "Error2 while getting Shortcut",
color: [0, 0, 0],
folder: "Errors",
});
}
}
} catch (e) {}
}
for (let shortcut of s.shortcuts()) {
try {
if (!shortcut.folder()) {
array.push({
name: shortcut.name(),
color: shortcut.color(),
folder: "Uncategorized",
});
}
} catch (e) {
array.push({
name: "Error1 while getting Shortcut.",
color: [0, 0, 0],
folder: "Errors",
});
}
}
} catch (e) {
array.push({
name: "Error3 while getting Shortcut",
color: [0, 0, 0],
folder: "Errors",
});
}
return JSON.stringify(array);
}
listAll();
bagre
March 11, 2026, 11:04pm
4
Thanks! Here it is:
"[{\"name\":\"Error3 while getting Shortcut\",\"color\":[0,0,0],\"folder\":\"Errors\"}]"
Ok there is definitely something preventing the script from retrieving your shortcuts.
You can try this script again? It might give a more detailed error:
const s = Application("Shortcuts Events");
function errorDetails(e) {
try {
return {
message: String(e),
name: e && e.name ? String(e.name) : "Error",
line: e && e.line ? e.line : null,
stack: e && e.stack ? String(e.stack) : null,
};
} catch (_) {
return {
message: "Could not stringify error",
name: "Error",
line: null,
stack: null,
};
}
}
function listAll() {
const array = [];
const errors = [];
try {
for (const folder of s.folders()) {
try {
for (const shortcut of folder.shortcuts()) {
try {
array.push({
name: shortcut.name(),
color: shortcut.color(),
folder: folder.name(),
});
} catch (e) {
errors.push({
stage: "reading shortcut inside folder",
folder: safeName(folder),
details: errorDetails(e),
});
}
}
} catch (e) {
errors.push({
stage: "reading shortcuts from folder",
folder: safeName(folder),
details: errorDetails(e),
});
}
}
for (const shortcut of s.shortcuts()) {
try {
let f;
try {
f = shortcut.folder();
} catch (e) {
errors.push({
stage: "reading shortcut.folder()",
shortcut: safeShortcutName(shortcut),
details: errorDetails(e),
});
f = null;
}
if (f === null || f === undefined) {
array.push({
name: shortcut.name(),
color: shortcut.color(),
folder: "Uncategorized",
});
}
} catch (e) {
errors.push({
stage: "reading top-level shortcut",
shortcut: safeShortcutName(shortcut),
details: errorDetails(e),
});
}
}
} catch (e) {
errors.push({
stage: "top-level",
details: errorDetails(e),
});
}
return JSON.stringify({
shortcuts: array,
errors: errors,
}, null, 2);
}
function safeName(folder) {
try {
return folder.name();
} catch (_) {
return "(unknown folder)";
}
}
function safeShortcutName(shortcut) {
try {
return shortcut.name();
} catch (_) {
return "(unknown shortcut)";
}
}
listAll();
bagre
March 16, 2026, 12:46pm
6
I uninstalled and installed BTT again and it started working. Would like me to run the script anyway? Thanks.
would be great, then maybe I can figure out what is wrong (in the latest builds I have added some workarounds which is probably why it works now, but these workarounds are not great)