Advertisement
Guest User

Untitled

a guest
Sep 16th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set theList to every paragraph of (do shell script "sudo softwareupdate -l")
  2. set updates to ""
  3. repeat with anItem in theList
  4.     if anItem starts with "   * " then
  5.         if updates is not "" then
  6.             set updates to updates & return
  7.         end if
  8.         set updates to updates & (characters 6 thru -1 of anItem)
  9.     end if
  10. end repeat
  11. if updates is not "" then
  12.     tell application "Finder"
  13.         ignoring application responses
  14.             display dialog "Software Update available:" & return & updates with title "Software Update available" buttons "OK" default button 1 with icon file ":System:Library:CoreServices:Software Update.app:Contents:Resources:Software Update.icns"
  15.         end ignoring
  16.     end tell
  17. end if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement