Posted on 05-20-2022 08:06 AM
Hi all,
I've scoured the internet and have had just about zero luck with this. I'm trying to get my script to request user input and it works great. When I load it into jamf self service it runs and then finishes with no error but never prompts the user for anything. Can someone point me in the right direction?
I've tried getting the current user and running the command as them but no change.
Posted on 05-20-2022 09:29 AM
Can you post the script, or at least the part causing you problems?
We do something similar using Self Service and have no issues.
here is a snippet of our script:
hmsid=`osascript -e 'set T to text returned of (display dialog "Enter the HMS Account ID (formerly eCommons ID) of the person who has primary responsibility for this computer:" buttons {"Set User Name"} default button "Set User Name" default answer "")'`
echo_log "You entered the HMS ID $hmsid."
The response is then added as a flag to the recon step near the end of the script.
Posted on 05-20-2022 09:53 AM
I have a couple scripts that run at login that are also available in Self Service that are currently working. Copy/paste edit for your needs, hopefully it gets you going!
Posted on 08-22-2022 09:19 PM
I'm actually having this exact issue. I did notice a few things:
This is turning in to an issue because I'm planning on using it to prompt users for their passwords if they're on M1 Macs to pass it to softwareupdate so it actually completes.
My code is really basic:
userpassword=$(osascript -e 'display dialog "Please enter your login password." default answer "" with icon stop buttons {"Cancel", "Continue"} default button "Continue" with hidden answer' | awk -F ':' '{print $3}')