Does Nothing in Big Sur
Tried using the sample Recipes scripts on brand new Stream Deck 4.9.3 and does nothing at all.
Yeah, I think there is a problem with those example. Some other guy opened yesterday this issue and I explained here https://github.com/gabrielperales/streamdeck-osascript/issues/1 how to make it work... and he did it. I also think there is a problem and the code script is not being loaded until you restart stream deck. I will look that ASAP.
It seems like you have to restart stream deck to make it work. But, specifically, you have restart stream deck after each new script / button is created. Jesse London 503-577-2224 Jesse L. London, Attorney at Law
On Mar 13, 2021, at 2:03 PM, Gabriel @.***> wrote:
Yeah, I think there is a problem with those example. Some other guy opened yesterday this issue and I explained here #1 https://github.com/gabrielperales/streamdeck-osascript/issues/1 how to make it work... and he did it. I also think there is a problem and the code script is not being loaded until you restart stream deck. I will look that ASAP.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gabrielperales/streamdeck-osascript/issues/2#issuecomment-798792615, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADM4AAJ3GIQSRWM5SITNXILTDPOL7ANCNFSM4ZDSQN6A.
Ok. I'll try to fix it 👍
Same problem here. The work around is indeed to restart Stream Deck after any manipulation to a script.
@oschrenk sorry about that, I couldn't find time to fix it. I'll try to do it this week
In macOS Big Sur 11.4:
The first time I restart Stream Deck after having associated my first script to a button, I get presented with the below message when I click that button (in that case I interact with Finder). The message subsequently doesn't appear when I restart Stream Deck again and I press that button.
Not sure if @gabrielperales changed anything, but it's now a minor annoyance.
But if I create a new button with a script (same script or different script) that interacts with Finder again, I need to restart Stream Deck again. Not prompted for permissions.
Then I created another script interacting with Safari and got presented with this after restart:
Maybe clarify in the Stream Deck Store release notes and GitHub that a restart is required every time one or many buttons are created, and that the user will be prompted by the OS to allow the Stream Deck Plugin to use AppleScript for every application it interacts with.
In 11.5.2, OSAScript execution fails silently, and doesn't invoke the permissions window.
The only log generated by ~/Library/Logs/StreamDeck just confirms the user action:
==> StreamDeck0.log <==
14:20:31.1084 void ESDActionsGridViewModel::onKeyPressed(): Key 11 pressed: com.gabrielperales.osascript.action
14:20:31.2099 void ESDActionsGridViewModel::onKeyReleased(): Key 11 released: com.gabrielperales.osascript.action
Edit: To note, I've followed the steps above, and restarted each time I've created a new button/script. Final Edit: Javascript execution works; but MacOS didn't ask to grant Stream Deck permission; the code simply ran. A bit confused why MacOS didn't pick up on this?
It seems you can unplug and replug the StreamDeck instead of closing the software.
The need to restart after changing/adding a script still applies.
pkill -HUP -f 'Stream Deck.app/Contents/MacOS/Stream Deck' && open -a Stream\ Deck
However, I was able to find out why some AppleScripts wouldn't work. Some actions aren't allowed from the StreamDeck executable.
Running the following.
display dialog "FooBar"
Makes this appear in the system logs.
NSLocalizedDescription = "No user interaction allowed.";
And by simply changing it to tell application "Finder" it works after clicking allow in the allow Stream Deck to control Finder window that appears.
tell application "Finder"
activate
display dialog "FooBar"
end tell
I assume this has something to do with sandboxing.
The problem with restarting the StreamDeck Application in macOS after every change in your script still exists. However I am glad that I found this nice plugin. Regards Ulrich
Restarting StreamDeck did the trick!
This is it. It has to be done every time you change a script.
On Ventura 13.0, cannot get this script to run even after restarting both Steam Deck and the whole OS. Relatively new to Apple Script so not 100% sure where to check in logs to see what occurs when I click the button. Can confirm script runs fine from terminal manually though.
osascript -e 'quit app "Google Chrome"'
Right as for dialog, I just had to put it within the tell; Then I was able to run my script. I Also did not need to restart the stream-deck, but rather change profile and then reload (change back to my edited profile). There is likely some command that can be run, maybe a button added to "Apply" (silently reloading / re-initialising) the plugin.
My Script
tell application "Google Chrome"
set theUrl to URL of active tab of front window
display dialog "The URL of the active tab is: " & theUrl
end tell