Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

osx-dialog

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

osx-dialog

Creates a dialog to the user.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

osx-dialog

Instead of dynamically writing AppleScript and then piping it into the binary, I decided to write a native module that uses CoreFoundation to display a dialog. Please open an issue if you have any feature requests or encounter any bugs!

usage

var dialog = require('osx-dialog')

dialog({
  title: 'A Title',
  msg: 'some message',
  timeout: 10,
  checkboxes: [
    'first box',
    'second box'
  ]
}, function (error, button, checkboxes) {
	// do stuff with the result.
})

###dialog(options, [callback])

  • options (required) has the following keys
    • title (required) is the bolded portion of the dialog
    • message (required) is the text area portion of the dialog
    • timeout (optional) is the duration in seconds the dialog should be displayed before it is dismissed
    • checkboxes (optional) is an array of strings that will be displayed as checkboxes
  • callback (optional) has the signature callback(error, button, checkboxes)
    • error will be null or a string with the error message
    • button will be a boolean noting if it was dismissed by hitting the button (true) or dismissed by hitting escape (false)
    • checkboxes will be an array of booleans with the status of the checkboxes in the order that was given to dialog

todo

  • Be able to set the buttons.
  • Be able to use radio types.

Keywords

FAQs

Package last updated on 01 Sep 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc