Skip to content

Latest commit

 

History

History
113 lines (97 loc) · 13.3 KB

cp.dialog.md

File metadata and controls

113 lines (97 loc) · 13.3 KB

docs » cp.dialog


A collection of handy Dialog tools for CommandPost.

This extension should no longer be used in favour of hs.dialog.

API Overview

API Documentation

Functions

Signature cp.dialog.displayAlertMessage(message) -> none
Type Function
Description Display an Alert Dialog (with stop icon).
Parameters
  • message - The message you want to display as a string
Returns
  • None
Notes
  • IMPORTANT: This should no longer be used in favour of hs.dialog.alert
Signature cp.dialog.displayChooseFile(whatMessage, fileType[, defaultLocation]) -> boolean or string
Type Function
Description Display a Choose File Dialog Box.
Parameters
  • whatMessage - The message you want to display as a string
  • fileType - The filetype you wish to display
  • defaultLocation - Path to Default Location
Returns
  • false if cancelled if pressed otherwise the path to the file as a string
Notes
  • IMPORTANT: This should no longer be used in favour of hs.dialog.chooseFileOrFolder
Signature cp.dialog.displayChooseFolder(whatMessage[, defaultLocation]) -> boolean or string
Type Function
Description Display a Choose Folder Dialog Box.
Parameters
  • whatMessage - The message you want to display as a string
  • defaultLocation - Path to Default Location
Returns
  • false if cancelled if pressed otherwise the path to the folder as a string
Notes
  • IMPORTANT: This should no longer be used in favour of hs.dialog.chooseFileOrFolder
Signature cp.dialog.displayChooseFromList(dialogPrompt, listOptions, defaultItems) -> table
Type Function
Description Displays a list that the user can select items from.
Parameters
  • dialogPrompt - The message you want to display as a string
  • listOptions - A table containing all the options you want to include in the list as strings
  • defaultItems - A table containing all the options you want select by default in the list as strings
Returns
  • A table with the selected items as strings
Signature cp.dialog.displayErrorMessage(whatError) -> none
Type Function
Description Display an Error Message Dialog, given the user the option to submit feedback.
Parameters
  • whatError - The message you want to display as a string
Returns
  • None
Notes
  • IMPORTANT: This should no longer be used in favour of hs.dialog.alert
Signature cp.dialog.displayMessage(whatMessage, optionalButtons) -> object
Type Function
Description Display an Error Message Dialog, given the user the option to submit feedback.
Parameters
  • whatError - The message you want to display as a string
Returns
  • None
Notes
  • IMPORTANT: This should no longer be used in favour of hs.dialog.alert
Signature cp.dialog.displayNotification(whatMessage) -> none
Type Function
Description Display's an alert on the screen.
Parameters
  • whatMessage - The message you want to display as a string
Returns
  • None
Notes
  • Any existing alerts will be removed to make way for the new one.
Signature cp.dialog.displaySmallNumberTextBoxMessage(whatMessage, whatErrorMessage, defaultAnswer) -> boolean or string
Type Function
Description Display a dialog box prompting the user for a number input. It accepts only entries that coerce directly to class integer.
Parameters
  • whatMessage - The message you want to display as a string
  • whatErrorMessage - The error message that appears if a user input is invalid
  • defaultAnswer - The default value of the text box
Returns
  • false if cancelled if pressed otherwise the text entered in the dialog box
Notes
  • IMPORTANT: This should no longer be used in favour of hs.dialog.textPrompt
Signature cp.dialog.displayTextBoxMessage(whatMessage, whatErrorMessage, defaultAnswer, validationFn) -> boolean or string
Type Function
Description Display a dialog box prompting the user for a text input.
Parameters
  • whatMessage - The message you want to display as a string
  • whatErrorMessage - The error message that appears if a user input is invalid
  • defaultAnswer - The default value of the text box
  • validationFn - A function that takes one parameter and returns a boolean value
Returns
  • false if cancelled if pressed otherwise the text entered in the dialog box
Notes
  • IMPORTANT: This should no longer be used in favour of hs.dialog.textPrompt
Signature cp.dialog.displayYesNoQuestion(message) -> boolean
Type Function
Description Displays a "Yes" or "No" question.
Parameters
  • whatMessage - The message you want to display as a string
Returns
  • true if yes is clicked otherwise false
Notes
  • IMPORTANT: This should no longer be used in favour of hs.dialog.alert