Display Alert
Octory PRO
Element type: Dictionary
Display an alert which can be customized.
Keys
Name | Type | Possible values | Required |
---|---|---|---|
Type | String | DisplayAlert | Required |
Title | String | - | Required |
Message | String | - | Required |
Style | String | Informational , Warning , Critical | Required |
ButtonsText | Array(String) | - | |
Variable | String | - | |
IconPath | String | - | |
Condition | Dictionary (Condition) | - |
Detail
Type Required
Type: String
Explanation: The type of the action has to be DisplayAlert
.
Title Required
Type: String
Explanation: The main text of the alert.
Message Required
Type: String
Explanation: The sub-text of the alert.
Style Required
Type: String
Possible values: Informational
, Warning
, Critical
Explanation: By setting this value, the alert will change its appearance accordingly.
There is no visual difference between Informational
and Warning
currently in Apple’s library.
ButtonsText
Type: Array(String)
Explanation: You can add up to three buttons to the alert. By adding a string item in the array, you ask to add button with the specified string for text.
Variable
Type: String
Explanation: If set, the application will add a variable with the name you specified. The value of the variable will be the text of the button clicked by the user. If you don’t specify any buttons text, the default button has a “OK” value.
IconPath
Type: String
Explanation: Lets you specifiy a custom icon file path for the alert. Do not forget to include the file extension.
Condition
Type: Dictionary (Condition)
Explanation: Allows launch the action only based on a boolean expression.
Example
Display an alert to inform the user. No buttons are specified, so the only one displayed is the default one with “OK” text.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ... -->
<key>ActionSets</key>
<array>
<dict>
<key>Type</key>
<string>Parallel</string>
<key>Triggers</key>
<array>
<string>NextButtonClick</string>
</array>
<key>Actions</key>
<array>
<dict>
<key>Type/<key>
<string>DisplayAlert</string>
<key>Title</key>
<string>Here is my title</string>
<key>Message</key>
<string>My message inside my alert!</string>
<key>Style</key>
<string>Informational</string>
</dict>
</array>
</dict>
</array>
<!-- ... -->
</dict>
</plist>
Display an alert with two buttons: “You can go” and “Doesn’t work on me, duh!”, an error style, and a variable UserLetPass
.
If the user clicks on “You can go”, Octory will create (or update if it already exists) the variable UserLetPass with the value You can go.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- ... -->
<key>ActionSets</key>
<array>
<dict>
<key>Type</key>
<string>Parallel</string>
<key>Triggers</key>
<array>
<string>Termination</string>
</array>
<key>Actions</key>
<array>
<dict>
<key>Type<key>
<string>DisplayAlert</string>
<key>Title</key>
<string>Let us pass</string>
<key>Message</key>
<string>These are not the Droids you are looking for</string>
<key>Style</key>
<string>Error</string>
<key>Variable</key>
<string>UserLetPass</string>
<key>ButtonsText</key>
<array>
<string>You can go</string>
<string>Doesn't work on me, duh!</string>
</array>
</dict>
</array>
</dict>
</array>
<!-- ... -->
</dict>
</plist>