Rafal Lukawiecki
New Member
For what it is worth, a workaround is to create an Automator app that runs an AppleScript, and assign a button in Streamdeck to launch that app. In my case, the script is:
on run {input, parameters}
set frontmostAppPath to (path to frontmost application) as text
activate application "OBS"
tell application "System Events"
key code 111
end tell
activate application frontmostAppPath
end run
This script will remember the currently active app, then activate OBS, sends it keycode 111 which is Apple code for F12, then reactivates the previously active app so it is back in the foreground. You need to assign the given key as a Transition hot key (F12 in my case) and look up its AppleScript code (I used https://eastmanreference.com/complete-list-of-applescript-key-codes). Finally, when you try running it, you will need to give your app the permission to use System Events to send keystrokes. This has a security implication if someone were to hijack your app to do something nefarious.
In any case, this solved the problem for me but it is not very elegant. I hope that StreamDeck figure out a way to enable that important functionality directly in their app.
on run {input, parameters}
set frontmostAppPath to (path to frontmost application) as text
activate application "OBS"
tell application "System Events"
key code 111
end tell
activate application frontmostAppPath
end run
This script will remember the currently active app, then activate OBS, sends it keycode 111 which is Apple code for F12, then reactivates the previously active app so it is back in the foreground. You need to assign the given key as a Transition hot key (F12 in my case) and look up its AppleScript code (I used https://eastmanreference.com/complete-list-of-applescript-key-codes). Finally, when you try running it, you will need to give your app the permission to use System Events to send keystrokes. This has a security implication if someone were to hijack your app to do something nefarious.
In any case, this solved the problem for me but it is not very elegant. I hope that StreamDeck figure out a way to enable that important functionality directly in their app.