Skip to content

darwin (Mac OS X) Tools

Tools to work with Darwin, Mac OS X's version of UNIX.

⬅ Parent


Usage

isDarwin

Are we on Mac OS X?

Arguments

  • none

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

Usage

darwinDialog [ --choice choiceText ] [ --ok ] [ --cancel ] --default buttonIndex [ --help ] message ...

Display a dialog using osascript with the choices provided. Typically this is found on Mac OS X. Outputs the selected button text upon exit.

Arguments

  • --choice choiceText - String. Optional. Title of the thing.
  • --ok - Flag. Optional. Adds "OK" as an option.
  • --cancel - Flag. Optional. Adds "Cancel" as an option.
  • --default buttonIndex - Integer. Required. The button (0-based index) to make the default button choice.
  • --help - Flag. Optional. Display this help.
  • message ... - String. Required. The message to display in the dialog.

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

Usage

darwinNotification [ --title ] [ --debug ] [ --sound soundName ] [ message ... ]

Display a notification for the user

Arguments

  • --title - String. Optional. Title of the notification.
  • --debug - Flag. Optional. Output the osascript as darwinNotification.debug at the application root after this call.
  • --sound soundName - String. Optional. Sound to play with the notification. Represents a sound base name found in /Library/Sounds/.
  • message ... - String. Optional. Message to display to the user in the dialog.

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

Sounds in Darwin

Usage

darwinSoundDirectory

Directory for user sounds

Arguments

  • none

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

Usage

darwinSoundInstall [ --help ] soundFile ... [ --create ]

Install a sound file for notifications

Arguments

  • --help - Flag. Optional. Display this help.
  • soundFile ... - File. Required. Sound file(s) to install in user library.
  • --create - Flag. Optional. Create sound directory if it does not exist.

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

Usage

darwinSoundNames

List valid sound names usable for notifications in Darwin

Arguments

  • none

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

Usage

darwinSoundValid

Is a Darwin sound name valid?

Arguments

  • none

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error