jamfHelper countdown

swapple
Contributor III

In the jamfhelper help screen,

Return Values: The JAMF Helper will print the following return values to stdout...
    0 - Button 1 was clicked
    1 - The Jamf Helper was unable to launch
    2 - Button 2 was clicked
    XX1 - Button 1 was clicked with a value of XX seconds selected in the drop-down
    XX2 - Button 2 was clicked with a value of XX seconds selected in the drop-down
    239 - The exit button was clicked
    243 - The window timed-out with no buttons on the screen
    250 - Bad "-windowType"
    255 - No "-windowType"

It only seems to output 0 or 2. letting it time out does not get 243 and clicking the buttons early does not get xx1 or xx2. What is missing here? I am interested in capturing timeouts as well as button clicks.

jamfHelper="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
windowType="hud"
description="Click a button"
button1="Install-Reboot"
button2="Cancel"
title="Button Clicker"
alignDescription="left"
alignHeading="center"
defaultButton="2"
timeout="6"
userChoice=$("$jamfHelper" -windowType "$windowType" -lockHUD -title "$title" -countdown -timeout "$timeout" -defaultButton "$defaultButton" -description "$description" -alignDescription "$alignDescription" -alignHeading "$alignHeading" -button1 "$button1" -button2 "$button2")
echo $userChoice
echo
2 REPLIES 2

sdagley
Esteemed Contributor II

@swhps If you have a defaultButton set then that's the return value on timeout. I've never tried it, but as I read the description a result of 243 would be for when you haven't specified any buttons to be displayed by jamfHelper.

swapple
Contributor III

when I take defaultButton out, it exits with 0. when I remove the buttons all together, it exits 243. Thanks for helping me understand. Sadly, that does not help. I was hoping to see a difference between someone clicking a button and the window just timing out.