The Addigy Self Service application, called MacManage.app, provides the ability to send custom prompts to end-users.
Below is an example script that can be altered to fit the desired functionality.
#!/bin/bash
/Library/Addigy/macmanage/MacManage.app/Contents/MacOS/MacManage action=notify title="Test Prompt" description="This is a test prompt" closeLabel="Close" acceptLabel="Accept" timeout=6000 forefront=false;
The script above would produce the following prompt on a device.
Note: Self Service prompts are not blocked by Do Not Disturb if it is enabled on a device.
Customization of Prompts
Description of script flags/attributes that can be altered:
- title - the text within the "" can be altered to change the text the user sees. This would change the Test Prompt text seen in the screenshot above.
- description - the text within the "" can be altered to change the text the user sees. This alters the "This is a test prompt" text seen in the screenshot above.
- closeLabel - the text within the "" can be altered to change the text the user sees on the close (left most) button. This alters the text found on the button shown as Close in the screenshot above.
- acceptLabel - the text within the "" can be altered to change the text the user sees on the accept (right most) button. This alters the text found on the button shown as Accept in the screenshot above.
- timeout - the value given to this flag/attribute is in seconds. It can be altered to change the amount of time before the prompt automatically closes. A visual of this can be seen on the text "This window will close automatically in 5971 seconds." In the screenshot above, where the total seconds is what can be altered.
- forefront (new in Self Service 1.0.21) - control if the prompt presented to the user comes to the foreground of their device or not. Valid values are true or false. When forefront is omitted, the notification will not come to the foreground.
- closable - used to make a prompt not closable and without a button. Should not have closeLabel or acceptLabel. Valid values are true or false. When closable is omitted or set to true, the notification will default to having just the "Ok" button.
Additional Details
Omitting the closeLabel and acceptLabel flags/attributes will default the prompt to having only an OK button displayed to the user. Here is an example of a script and prompt with only the OK button used. With this configuration, selecting the OK button will return 1 (error), which is used for if statements.
#!/bin/bash if /Library/Addigy/macmanage/MacManage.app/Contents/MacOS/MacManage action=notify title="Test Prompt" description="This is a test prompt" timeout=6000; then echo "User selected Ok" exit 0 fi
Omitting the timeout flag/attribute additionally removed the automatic countdown timer of when the prompt will close, as well as not force close the prompt. The prompt will thus remain displayed to the user indefinitely until the user acknowledges it. Here is an example script and prompt without using a timeout. forefront=true will put the dialog on the top of the user's desktop.
#!/bin/bash /Library/Addigy/macmanage/MacManage.app/Contents/MacOS/MacManage action=notify title="Test Prompt" description="This is a test prompt" forefront=true
Example Customized Prompt with Variables
#!/bin/bash
# Adjust these variables as they will replace the text in the flags
title="A Notification"
description="Example of a description text"
acceptText="Accept"
closeText="Close"
timeOut=600
forefront="False"
if /Library/Addigy/macmanage/MacManage.app/Contents/MacOS/MacManage action=notify title="${title}" description="${description}" closeLabel="${closeText}" acceptLabel="${acceptText}" timeout="$timeOut" forefront="$forefront"; then
# executes a desired command if the user clicks the Accept label.
echo "Accept label clicked"
exit 0
else
# executes a desired command if the user clicks the Close label.
echo "Close label clicked"
exit 1
fi
The script above details how a command can be run based on the user's interaction with the prompt. The if statement returns true (exit 0) if the user clicks the Accept label and false (exit 1) if the user clicks the Close label.
Changing the Logo
If you would like to change the logo, just add a valid .icns file to a Self Service configuration and deploy it to the policy.