Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does Nothing in Big Sur #2

Open
jesselondon opened this issue Mar 13, 2021 · 13 comments
Open

Does Nothing in Big Sur #2

jesselondon opened this issue Mar 13, 2021 · 13 comments

Comments

@jesselondon
Copy link

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

@gabrielperales
Copy link
Owner

Yeah, I think there is a problem with those example. Some other guy opened yesterday this issue and I explained here #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.

@jesselondon
Copy link
Author

jesselondon commented Mar 14, 2021 via email

@gabrielperales
Copy link
Owner

Ok. I'll try to fix it 👍

@oschrenk
Copy link

oschrenk commented Apr 5, 2021

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

@gabrielperales
Copy link
Owner

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

@menant
Copy link

menant commented Jul 21, 2021

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.

@webdog
Copy link

webdog commented Aug 25, 2021

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?

@daringeric
Copy link

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

@versionsix
Copy link

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.

@us0906
Copy link

us0906 commented Feb 25, 2022

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

@mircobabini
Copy link

mircobabini commented Apr 3, 2022

Restarting StreamDeck did the trick!

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

@CyricPL
Copy link

CyricPL commented Nov 2, 2022

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

@Lewiscowles1986
Copy link

Lewiscowles1986 commented Jul 24, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests