No longer able to select a shortcut for the action "Run Shortcut from Shortcuts App"

Describe the bug
I am no longer able to select a shortcut with the action "Run Shortcut from Shortcuts App." Also, my previously configured shortcut actions are still working, but the specific shortcut is no longer showing. I restarted my system since this started occurring.

Screenshots

Device information:

  • Type of Mac: MBP 16" M1 Max
  • macOS version: 13.4.1
  • BetterTouchTool version: 4.144 (2358)

Additional information (e.g. StackTraces, related issues, screenshots, workarounds, etc.):

Could you check what this script outputs if you run it via Apple's Script editor?

s = Application('Shortcuts Events'); function listAll() { let array = []; try { for(let folder of s.folders()) { for(let shortcut of folder.shortcuts()) { array.push({ name: shortcut.name(), color: shortcut.color(), folder: folder.name() }) } } for(let shortcut of s.shortcuts()) { if(!shortcut.folder()) { array.push({ name: shortcut.name(), color: shortcut.color(), folder: 'Uncategorized' }) } } } catch(e) { return e } return array; } listAll()

Make sure to select JavaScript on the top left:

Possibly the Shortcuts Events process has crashed. You can try killing it in Activity Monitor (it will automatically start again) and then restart BetterTouchTool

The screenshot is the same result of before and after the force quitting of Shortcut Events and restarting BTT waiting for both Shortcut Events and BTT to relaunch.

looks like for some reason the Shortcuts app throws an error with at least one of your shortcuts. Maybe some special characters in its name?

I recently changed the script, previously it would have returned the Shortcuts that didn’t throw an error. I’ll upload a new version that brings back the old behavior in 1-2h - but the best solution would be to find which shortcut or folder is causing this

Could you check the result of this script?

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 array;
}
listAll();

This link is for the rtf file for the result. I will look into removing any special characters from my folders and shortcut names tomorrow.

Great, the updated script is integrated in the new BTT version, which should now show your shortcuts again.

With the 4.149 (2362) update, I can select shortcuts now. Thank you for the quick response and fix.

Great!
It will probably show one section "Errors", there the shortcuts that couldn't be loaded are listed (unfortunately without their name because I can't get it).

It looks like this is a bug in Shortcuts Events, it is for example triggered by non-standard spaces and maybe other special characters.

Thanks for that info and I was able to track down the problem shortcut. I had 3 errors in the shortcut list in BTT, which I assumed referred to 3 problem shortcuts, but it was only one shortcut causing the issue. I tracked one down called "New Shortcut" without the quotes. When I edited the shortcut to view, I had a 2 versions conflict and kept the most recent one. The shortcut's name automatically changed to the first action command in the shortcut, and all 3 errors in the shortcut list in BTT are gone now.