Skip to content
This repository has been archived by the owner on Jun 3, 2022. It is now read-only.

MacOS not working #4

Open
sooslaca opened this issue Jul 25, 2018 · 5 comments
Open

MacOS not working #4

sooslaca opened this issue Jul 25, 2018 · 5 comments

Comments

@sooslaca
Copy link

Sorry, dunno how to open a pull request.

message_darwin.go line 61:

Change
From: tell application "System Events" to display dialog ....
To: display dialog ...

Otherwise you get (because of "with icon" part):
28:115: execution error: System Events got an error: Can’t make application "System Events" into type number or string. (-1700)

https://docwhat.org/mac-shell-dialogs

@gen2brain
Copy link
Owner

Hey, there was this pull request #3 , so not sure what is the correct fix here @leonjza .

@leonjza
Copy link
Contributor

leonjza commented Sep 8, 2018

Hmm, problem with not "telling" a specific application is that when you are not in a logged in user context, there will be no dialog at all.

@gen2brain
Copy link
Owner

@sooslaca why do you think it is because of "with icon" part, it works ok without it?
I don't use macOS so I don't really understand that well all those telling, there was this issue with color selector #1 where app was hanging until you "tell".

@sooslaca
Copy link
Author

hey, I'm not a MAC guru either, but here is the proof from Terminal app:

WITH ICON:

MACMACHINE:~ user$ osascript -e 'tell app "System Events" to display dialog "A stop dialog with only one button." buttons "OK" default button 1 with title "and a title" with icon stop'
28:150: execution error: System Events got an error: Can’t make application "System Events" into type number or string. (-1700)

(dialog is NOT displayed)

WITHOUT ICON:

MACMACHINE:~ user$ osascript -e 'tell app "System Events" to display dialog "A stop dialog with only one button." buttons "OK" default button 1 with title "and a title"'
button returned:OK

(after this dialog displays)

OS VERSION:

MACMACHINE:~ user$ uname -a
Darwin MACMACHINE 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64

@sooslaca
Copy link
Author

Also works in terminal if I leave out 'tell app "System Events"

MACMACHINE:~ user$ osascript -e 'display dialog "A stop dialog with only one button." buttons "OK" default button 1 with title "and a title" with icon stop'
button returned:OK

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

No branches or pull requests

3 participants