streamdeck-osascript icon indicating copy to clipboard operation
streamdeck-osascript copied to clipboard

Does Nothing in Big Sur

Open jesselondon opened this issue 4 years ago • 13 comments

Tried using the sample Recipes scripts on brand new Stream Deck 4.9.3 and does nothing at all.

jesselondon avatar Mar 13 '21 08:03 jesselondon

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.

gabrielperales avatar Mar 13 '21 22:03 gabrielperales

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.

jesselondon avatar Mar 14 '21 23:03 jesselondon

Ok. I'll try to fix it 👍

gabrielperales avatar Mar 15 '21 09:03 gabrielperales

Same problem here. The work around is indeed to restart Stream Deck after any manipulation to a script.

oschrenk avatar Apr 05 '21 08:04 oschrenk

@oschrenk sorry about that, I couldn't find time to fix it. I'll try to do it this week

gabrielperales avatar Apr 05 '21 11:04 gabrielperales

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. Screen Shot 2021-07-21 at 2 40 51 PM 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: Screen Shot 2021-07-21 at 3 00 16 PM 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.

menant avatar Jul 21 '21 21:07 menant

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?

webdog avatar Aug 25 '21 19:08 webdog

It seems you can unplug and replug the StreamDeck instead of closing the software.

daringeric avatar Oct 11 '21 19:10 daringeric

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.

versionsix avatar Nov 28 '21 19:11 versionsix

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

us0906 avatar Feb 25 '22 16:02 us0906

Restarting StreamDeck did the trick!

This is it. It has to be done every time you change a script.

mircobabini avatar Apr 03 '22 09:04 mircobabini

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"'

CyricPL avatar Nov 02 '22 16:11 CyricPL

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

Lewiscowles1986 avatar Jul 24 '23 12:07 Lewiscowles1986