CocoaDialog: Difference between revisions

From HaFrWiki42
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 7: Line 7:


== Download ==
== Download ==
* [http://mstratman.github.io/cocoadialog/#download Download], Download the Application and Install it into the Applications directory.
Download the script <ref>[http://mstratman.github.io/cocoadialog/#download Download], Download the Application and Install it into the Applications directory.</ref> and save it into the ''/usr/bin'' directory with the name ''cocoaDialog'':
<pre>
#!/usr/bin/perl
use strict;
use warnings;
 
my $path = "/Applications";
my $cd = "$path/cocoaDialog.app/Contents/MacOS/cocoaDialog";
 
system($cd, @ARGV);
</pre>
Please note:
# Change the ''$path'' entry into the location where you saved the ''cocoaDialog.app'' directory.
# You need sudo-rights to save the script with the name cocoaDialog in the /usr/bin directory.
# You need to chmod the execution right to ag+x <pre>sudo chmod ag+x /usr/bin/cocoaDialog</pre>


== Documentation ==
== Documentation ==
 
The documentation contains also examples of the different dialogs. Please read the example carefully because there are some nasty dialog requirements which may cause a dialog to hang into your system.
* [http://mstratman.github.io/cocoadialog/#documentation cocoaDialog], Documentation.


== See also ==
== See also ==

Revision as of 16:49, 24 January 2015

A nice addition to the Apple OSX environment is the option to send message notifications yo the user. The aim of cocoaDialog [1] is just that.

Overview

The application cocoaDialog is an OS X application that allows the use of common GUI controls such as file selectors, text input, progress bars, yes/no confirmations and more with a command-line application. It requires no knowledge of Cocoa, and is ideal for use in shell and Perl scripts (or Ruby, or Python, or... etc).

Download

Download the script [2] and save it into the /usr/bin directory with the name cocoaDialog:

#!/usr/bin/perl
use strict;
use warnings;

my $path = "/Applications";
my $cd = "$path/cocoaDialog.app/Contents/MacOS/cocoaDialog";

system($cd, @ARGV);

Please note:

  1. Change the $path entry into the location where you saved the cocoaDialog.app directory.
  2. You need sudo-rights to save the script with the name cocoaDialog in the /usr/bin directory.
  3. You need to chmod the execution right to ag+x
    sudo chmod ag+x /usr/bin/cocoaDialog

Documentation

The documentation contains also examples of the different dialogs. Please read the example carefully because there are some nasty dialog requirements which may cause a dialog to hang into your system.

See also

top

Reference

top

  1. ↑ CocoaDialog, Home page on GitHuh of the CocoaDialog. The Application is create by Mark A. Stratman.
  2. ↑ Download, Download the Application and Install it into the Applications directory.