Hi,
For context, I am trying to use a hotkey to trigger a Workflow to open a new Chrome incognito tab (if none is open) and switch to a Chrome incognito tab if there is one. I have mapped it to Cmd + Option + N (though I don't think this matters).
The issue would be more straightforward if this straight-up doesn't work. The weird thing is that it mostly works, then it stops working, but when I restart my laptop, it works again. In previous versions of macOS/Alfred, this has mostly worked, so this seems to be a new issue.
Steps taken to debug and other relevant info:
- I have used ShortcutDetective and it shows that Alfred is the one receiving the shortcut
- On macOS 11.5.1 and Alfred 4.5
- See AppleScript code below (not sure if this might be relevant)
On a side note, I have recently experienced a similar issue with using caps to change my input source, i.e. it became flaky but works after restart. Not sure if related (Alfred wasn't involved in that). I'd prefer not to restart my laptop every few days.
The relevant AppleScript triggered by the workflow, in case anyone is interested:
on alfred_script(q)
tell application "Google Chrome"
-- Open incognito window
set W to every window whose mode is "incognito"
if W = {} then set W to {make new window with properties {mode:"incognito"}}
set [W] to W
-- Focus incognito window
set index of W to 1
activate
set emptyTab to my lookupTabWithUrl("chrome://newtab/")
if emptyTab is not null then
close emptyTab
end if
-- Focus incognito window
set index of W to 1
activate
end tell
end alfred_script