Software Update AppleScript [Updated]

Software Update AppleScript [Updated]

February 13th, 2010 // 1:00 pm @

Check out this site for a handy AppleScript to manage changing between Apple’s Software Update Servers and a local Software Update server running on a Mac OS X on your own network.

http://neverblog.net/create-an-applescript-gui-to-set-a-local-software-update-server/

While the above script has served it’s purpose, I have had to extend it to work with Snow Leopard:

display dialog "Set Update Server" buttons {"Cancel", "Apple", "Local"} default button 3
if the button returned of the result is "Local" then
	tell application "System Events"
		set OSVersion to do shell script "sw_vers -productVersion"
	end tell
	if OSVersion starts with "10.4" then
		-- set up Tiger thing
		set catalogURLValue to "http://server01.in.scc.tas.edu.au:8088/index.sucatalog"
	else if OSVersion starts with "10.5" then
		-- set up Leopard thing
		set catalogURLValue to "http://server01.in.scc.tas.edu.au:8088/index-leopard.merged-1.sucatalog"
	else if OSVersion starts with "10.6" then
		-- set up Snow Leopard thing
		set catalogURLValue to "http://server01.in.scc.tas.edu.au:8088/index-leopard-snowleopard.merged-1.sucatalog"
	else
		--bail, because it's panther or less
		return
	end if
	
	do shell script "defaults write /Library/Preferences/com.apple.Softwareupdate CatalogURL " & catalogURLValue
else
	do shell script "defaults delete /Library/Preferences/com.apple.SoftwareUpdate CatalogURL"
end if

Category : Mac OS X

Comments are closed.

Latest News

Certifications