Skip to main content
Solved

Calling any AppleScripting Wizards for scripting button click in UI


Forum|alt.badge.img+18
  • Esteemed Contributor
  • 831 replies

Hey all, we have had an issue where about 653 of our laptops didnt renew their MDM profile when it was expiring.

I'm now in process of re-enrolling them with the profiles renew -type enrollment command, however it prompts the end user to go a click install on their computer to complete the process.  Since we had them approve the ability for applescript to do keystrokes and mouse clicks perviously, I am thinking I could script the click of the update button in notification center when it pops up.

 

I'm struggling to determine the UI element that is showing this button though.  Does anyone have any clues to processing the click of the update button seen here?  I always respect @mm2270 and their work, wondering if you have any idea if I can make it click this update button.

Best answer by boberito

The Jamf seal heal thing works great when the Jamf binary is broke. This is for the MDM Profile.

I don't think there is a way to GUI script notification acknowledgement. There are ways to script mouse clicks at a specific location - https://apple.stackexchange.com/questions/266784/how-do-i-make-the-mouse-click-at-current-location-using-applescript gives a small idea. 

View original
Did this topic help you find an answer to your question?

4 replies

Forum|alt.badge.img+4
  • New Contributor
  • 13 replies
  • November 21, 2022

Check this out instead. We were able to repair a number of devices with the API.

https://www.modtitan.com/2022/02/jamf-binary-self-heal-with-jamf-api.html


boberito
Forum|alt.badge.img+22
  • Jamf Heroes
  • 449 replies
  • Answer
  • November 21, 2022

The Jamf seal heal thing works great when the Jamf binary is broke. This is for the MDM Profile.

I don't think there is a way to GUI script notification acknowledgement. There are ways to script mouse clicks at a specific location - https://apple.stackexchange.com/questions/266784/how-do-i-make-the-mouse-click-at-current-location-using-applescript gives a small idea. 


Forum|alt.badge.img+18
  • Author
  • Esteemed Contributor
  • 831 replies
  • November 21, 2022

@KrisMallory Yea, the self healing is just for the framework not for mdm.  If the mdm profile doesnt renew for some reason its a full re enrollment thats needed, but I think I found a way to automate this as much as possible.

@boberito Yea thanks, I was trying to tell it to use the UI info in the notifications box to click the update button, but if i keep it more generalized, it looks like I can make this work with just the coordinates.  

If anyone else is looking for this after pushing a sudo profiles renew -type enrollment command just run this for a 13" MacBook Air:

 

 

 

#!/bin/bash currentUser=$(/bin/ls -l /dev/console | /usr/bin/awk '{print $3}') profiles renew -type enrollment sudo -u $currentUser osascript <<EOF tell application "System Events" delay 2 click at {1242, 96} -- {from left, from top} click at {1242, 96} -- {from left, from top} delay 2 click at {772, 366} -- {from left, from top} end tell EOF

 

 

 

 


Forum|alt.badge.img+2
  • New Contributor
  • 20 replies
  • November 22, 2022

I wonder if umad would detect this situation also and encourage the user towards clicking the option ?

https://github.com/macadmins/umad


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings