julienXX / terminal-notifier

Send User Notifications on macOS from the command-line.
Other
6.37k stars 330 forks source link

Return button values from perl script call? #232

Closed BambiB closed 7 years ago

BambiB commented 7 years ago

Execute the following lines from within a perl script: $p= terminal-notifier -message "Hello?" -sound sosumi -timeout 59 -closeLabel override -actions VALUE1,VALUE2; print "•••",dump ($p),"•••";

The output is:

•••""••• 2017-07-06 12:35:55.547 terminal-notifier[53095:13371416] @override

How do I capture the selected button in a variable?

An example of calling terminal-notifier from a perl script and returning which button was pushed is probably all I need.

TIA!

julienXX commented 7 years ago

@BambiB You have a -json option to get the output as JSON, perhaps it will be easier.

BambiB commented 7 years ago

Well, the -json option returns something, so basically it works and the simple text return does not. I'm still a little confused as to why the variable $p isn't getting set in the code I listed above. But until they fix the bug, this should work.

Thanks!