12-05-2022 12:17 PM - edited 12-05-2022 12:18 PM
Having a bit of a weird issue. So I have this script that pops a notification box open on check-in, and it's working fine, except that it won't display the branding icon in the box. It's probably easier to show than to tell, so see below (executing this script in macOS Ventura 13.0.1):
jamfHelper="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
windowType="hud"
description="Insert description here (edited for the sake of this forum post)"
icon="~/Library/Application\ Support/com.jamfsoftware.selfservice.mac/Documents/Images/brandingimage.png" #this path is accurate
title="macOS Update Required"
alignDescription="left"
alignHeading="center"
button1="OK"
timeout="600"
window=$("$jamfHelper" -windowType "$windowType" -lockHUD -title "$title" -timeout "$timeout" -icon "$icon" -description "$description" -alignDescription "$alignDescription" -alignHeading "$alignHeading" -button1 "$button1")
What am I doing wrong?
Solved! Go to Solution.
Posted on 12-08-2022 06:49 AM
Nice, thanks for this! I ended up combining yours and @YanW's suggestions. This syntax gave me the result I was looking for:
icon="Users/$loggedInUser/Library/Application Support/com.jamfsoftware.selfservice.mac/Documents/Images/brandingimage.png"
Posted on 12-05-2022 02:25 PM
In my experience, Jamf doesn't like the current user being represented by ~
I would change this to a variable. something like...
currentUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`
icon="$currentUser/Library/Application\ Support/com.jamfsoftware.selfservice.mac/Documents/Images/brandingimage.png" #this path is accurate
Hopefully this helps.
Posted on 12-08-2022 06:49 AM
Nice, thanks for this! I ended up combining yours and @YanW's suggestions. This syntax gave me the result I was looking for:
icon="Users/$loggedInUser/Library/Application Support/com.jamfsoftware.selfservice.mac/Documents/Images/brandingimage.png"
Posted on 12-05-2022 05:30 PM
maybe try either removing the \ between Application Support or the ""
Posted on 12-06-2022 01:20 PM
Yeah, one or the other there...I've had that cause troubles with some items over the years...
Posted on 12-08-2022 06:49 AM
Thanks for this tip!