dlgs icon indicating copy to clipboard operation
dlgs copied to clipboard

MacOS not working

Open sooslaca opened this issue 6 years ago • 5 comments

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

sooslaca avatar Jul 25 '18 10:07 sooslaca

Hey, there was this pull request https://github.com/gen2brain/dlgs/pull/3 , so not sure what is the correct fix here @leonjza .

gen2brain avatar Sep 08 '18 13:09 gen2brain

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.

leonjza avatar Sep 08 '18 13:09 leonjza

@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 https://github.com/gen2brain/dlgs/issues/1 where app was hanging until you "tell".

gen2brain avatar Sep 08 '18 16:09 gen2brain

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 avatar Sep 12 '18 09:09 sooslaca

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

sooslaca avatar Sep 12 '18 10:09 sooslaca