Turn off debug messages

Turn off debug messages

-- This is the master machq script to replace all others!
-- First find out the version of OS X

global osVersion
global externalIP
global SWUpdateServer
global store

set osVersion to do shell script "/usr/bin/sw_vers -productVersion | /usr/bin/awk -F . '{print $2}'"

try
	set externalIP to do shell script "/usr/bin/curl http://icanhazip.com/"

	set test1 to do shell script "/usr/bin/dig +short 001.machq.com"
	set test2 to do shell script "/usr/bin/dig +short 002.machq.com"
	set test3 to do shell script "/usr/bin/dig +short 003.machq.com"

	if externalIP is test1 then
		set store to "001"
		set SWUpdateServer to "mhq-swupdate.local:8088"
	else if externalIP is test2 then
		set store to "002"
		set SWUpdateServer to "xserve.local:8088"
	else if externalIP is test3 then
		set store to "003"
		set SWUpdateServer to "servercdr.local:8088"
	end if

on error
	--can't determine which store automatically
	set theStoreList to {"St. Louis", "O'Fallon", "Cedar Rapids"}
	set theStore to choose from list theStoreList with title "Help!" with prompt "Where are we?"

	if theStore as string is "St. Louis" then
		set SWUpdateServer to "mhq-swupdate.local:8088"
	else if theStore as string is "O'Fallon" then
		set SWUpdateServer to "xserve.local:8088"
	else if theStore as string is "Cedar Rapids" then
		set SWUpdateServer to "servercdr.local:8088"
	end if

end try

--display dialog osVersion buttons {"OK"}

--display dialog SWUpdateServer buttons {"OK"}

set theButtonNames to {"Set Used Prefs (all *'ed items)", "Set SWUpdateServer*", "List SWUpdateServer", "Remove SWUpdateServer", "Set MacHQ homepage*", "Disable Sleep*", "Rename HD by Size*", "Install MHQ Reset Script", "Remove Current User & Reset CPU", "Install Tech User Reset Script", "Test for Flashback Trojan", "Test for ShellShock vulnerability", "Rebuild Launch Services DB", "Flush DNS Cache", "Reinstall default Fake preferences", "Update Fake Workflows from Server", "Install SWUpdate StartupItem", "Save System Profiler Report to server"}

repeat
	set theChoice to choose from list theButtonNames
	if theChoice is false then
		exit repeat
	else if theChoice as string is "Set SWUpdateServer*" then
		setSWUpdateServer()
	else if theChoice as string is "List SWUpdateServer" then
		listSWUpdateServer()
	else if theChoice as string is "Remove SWUpdateServer" then
		resetSWUpdateServer()
	else if theChoice as string is "Set MacHQ homepage*" then
		setHomePage()
	else if theChoice as string is "Set Used Prefs (all *'ed items)" then
		setUsedPrefs()
	else if theChoice as string is "Disable Sleep*" then
		disableSleep()
	else if theChoice as string is "Rename HD by Size*" then
		renameHDbySize()
	else if theChoice as string is "Install MHQ Reset Script" then
		installResetScript()
	else if theChoice as string is "Remove MHQ User & Reset CPU" then
		if resetUserCPU() = -128 then
			return
		end if
	else if theChoice as string is "Remove Current User & Reset CPU" then
		if resetThisUserCPU() = -128 then
			return
		end if
	else if theChoice as string is "Install Tech User Reset Script" then
		installTechResetScript()
	else if theChoice as string is "Test for Flashback Trojan" then
		testForFlashbackTrojan()
	else if theChoice as string is "Rebuild Launch Services DB" then
		rebuildLaunchServicesDB()
	else if theChoice as string is "Reinstall default Fake preferences" then
		reinstallDefaultFakePreferences()
	else if theChoice as string is "Reinstall Fake Workflows" then
		reinstallFakeWorkflows()
	else if theChoice as string is "Install SWUpdate StartupItem" then
		InstallSWUpdatePlist()
	else if theChoice as string is "Flush DNS Cache" then
		FlushDNSCache()
	else if theChoice as string is "Save System Profiler Report to server" then
		SystemProfilerReport()
	else if theChoice as string is "Update Fake Workflows from Server" then
		UpdateWorkflowsFromServer()
	else if theChoice as string is "Test for ShellShock vulnerability" then
		testForShellShockVulnerability()
	else
		tell me to quit
	end if

end repeat

on setUsedPrefs()
	disableSleep()
	setSWUpdateServer()
	setHomePage()
	renameHDbySize()
end setUsedPrefs

on setHomePage()
	set fileTarget to (path to library folder from user domain as text) & "Preferences:com.apple.Safari.plist"

	try
		-- we don't really need the alias; we're just checking to see if it exists
		fileTarget as alias
	on error
		tell application "Safari"
			activate
		end tell
	end try
	if running of application "Safari" then
		tell application "Safari"
			quit
		end tell
		repeat while (running of application "Safari")
			delay 1
		end repeat
		delay 2
	end if
	do shell script "defaults write com.apple.Safari HomePage http://twitter.com/machq; defaults write com.apple.Safari NewWindowBehavior 0"
	delay 2
	tell application "Safari"
		activate
		delay 2
		close every window
		quit
	end tell
end setHomePage

on listSWUpdateServer()
	try
		set server_name to do shell script "defaults read /Library/Preferences/com.apple.SoftwareUpdate CatalogURL"
		display dialog "SW update server is: " & server_name buttons {"OK"}
	on error
		display dialog "Using default Apple SW Update Server" buttons {"OK"}
	end try
end listSWUpdateServer

on resetSWUpdateServer()
	try
		--if running in 10.7 or later we need to supply password

		if (osVersion as number > 7) then
			do shell script "defaults delete /Library/Preferences/com.apple.SoftwareUpdate CatalogURL" with administrator privileges
		else
			do shell script "/usr/bin/defaults delete /Library/Preferences/com.apple.SoftwareUpdate CatalogURL"
		end if

		--do shell script "defaults delete /Library/Preferences/com.apple.SoftwareUpdate CatalogURL"
	end try
end resetSWUpdateServer

on disableSleep()
	try
		do shell script "pmset -c displaysleep 0 sleep 0 disksleep 0" with administrator privileges
	end try
end disableSleep

on renameHDbySize()
	set theSetScript to "

#!/bin/bash

boot_vol=`bless --getBoot`

boot_disk=`diskutil info ${boot_vol} |sed '/^ *Volume Name: */!d;s###'`

disk_size=`system_profiler SPSerialATADataType |sed '/^ *Capacity: */!d;s###' | awk '{print int($1+0.5)  $2\" HD\"}' | head -n 1 `

diskutil rename \"${boot_disk}\" \"${disk_size}\"

# Show icons for hard drives, servers, and removable media on the desktop
#defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
#defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
#defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true

killall Finder

"
	do shell script theSetScript

end renameHDbySize

on setSWUpdateServer()

	set theSetScript to "

#!/bin/bash

URL1='http://" & SWUpdateServer & "'
    case `/usr/bin/sw_vers -productVersion | /usr/bin/awk -F . '{print $2}'` in
      4) URL=\"${URL1}/index.sucatalog\" ;;
      5) URL=\"${URL1}/index-leopard.merged-1.sucatalog\" ;;
      6) URL=\"${URL1}/index-leopard-snowleopard.merged-1.sucatalog\" ;;
	7) URL=\"${URL1}/index-lion-snowleopard-leopard.merged-1.sucatalog\" ;;
	8) URL=\"${URL1}/index-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog\" ;;
	9) URL=\"${URL1}/index-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog\" ;;
	10) URL=\"${URL1}/index-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog\" ;;
      *) echo \"Unsupported client OS\"; exit 1 ;;
    esac

/usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL \"${URL}\"

	"
	--if running in 10.7 or 10.8 we need to supply password
	try
		if (osVersion as number > 7) then
			do shell script theSetScript with administrator privileges
		else
			do shell script theSetScript
		end if
	end try
end setSWUpdateServer

on installResetScript()
	try
		set TheFile to ((path to me as string) & "Contents:Resources:mhqreset.sh") as alias
		tell application "Finder"
			duplicate TheFile to the startup disk with replacing
		end tell
	end try
end installResetScript

on resetUserCPU()
	try
		display dialog "This will install the MHQ reset script and restart the computer into single user mode, then run the reset script automatically. Do you wish to continue?" buttons {"Quit", "Continue"} default button "Continue" cancel button "Quit"
		installResetScript()

		if osVersion is "10" then
			set target_file to ".bashrc"
		else
			set target_file to ".profile"
		end if

		do shell script "echo \"sh /mhqreset.sh\" >> /private/var/root/" & target_file with administrator privileges

		do shell script "nvram boot-args=\"-s\"" with administrator privileges

		tell application "Finder" to restart
		return -128
	end try
end resetUserCPU

on resetThisUserCPU()
	try
		tell application "System Events"
			set current_user to get the name of current user
		end tell

		display dialog "This will install the MHQ reset script and restart the computer into single user mode, then run the reset script automatically. The user \"" & current_user & "\" will be deleted with all it's files. Do you wish to continue?" buttons {"Quit", "Continue"} default button "Continue" cancel button "Quit"
		display dialog "Are you absolutely certain?. The user \"" & current_user & "\" will be deleted with all it's files. Do you wish to continue?" buttons {"Quit", "Continue"} default button "Continue" cancel button "Quit"
		installResetScript()

		if osVersion is "10" then
			set target_file to ".bashrc"
		else
			set target_file to ".profile"
		end if

		do shell script "echo \"sh /mhqreset.sh\" " & current_user & " >> /private/var/root/" & target_file with administrator privileges

		do shell script "nvram boot-args=\"-s\"" with administrator privileges

		tell application "Finder" to restart
		return -128
	end try
end resetThisUserCPU

on installTechResetScript()
	set TheFile to ((path to me as string) & "Contents:Resources:techreset.sh") as alias
	tell application "Finder"
		duplicate TheFile to the startup disk with replacing
	end tell

end installTechResetScript

on InstallSWUpdatePlist()

	set TheFile to ((path to me as string) & "Contents:Resources:Set SWUpdate Server") as alias

	if (osVersion as number > 7) then

		tell application "Finder"
			duplicate TheFile to (path to startup items from local domain as alias) with replacing
		end tell
	else

		set theScript to "

		#!/bin/bash

		if [ ! -e '/Library/StartupItems/Set SWUpdate Server' ]; then
		    mkdir '/Library/StartupItems/Set SWUpdate Server'
		fi
		cp -R '" & (the POSIX path of TheFile) & "' '/Library/StartupItems/Set SWUpdate Server/.'
		"
		do shell script theScript with administrator privileges

	end if

	do shell script "chmod -R 755 '/Library/StartupItems/Set SWUpdate Server'; sudo chown -R root:wheel '/Library/StartupItems/Set SWUpdate Server'" with administrator privileges

end InstallSWUpdatePlist

on testForFlashbackTrojan()
	display alert ("Beginning test") message "Testing for presence of Flashback trojan. Keep in mind this is NOT a definitive test!"

	try
		set check1 to do shell script "defaults read /Applications/Safari.app/Contents/Info LSEnvironment"
		display alert ("Possible infection!") message "Recommend running full antivirus scan with up to date scanner. Please note this test is a first release and may produce false positives."

	on error error_message number error_number
		if error_number is equal to 1 then
			display alert ("Alert!") message "First check appears okay"
		end if
	end try

	try
		set check2 to do shell script "defaults read ~/.MacOSX/environment DYLD_INSERT_LIBRARIES"
		display alert ("Possible infection!") message "Recommend running full antivirus scan with up to date scanner. Please note this test is a first release and may produce false positives."

	on error error_message number error_number
		if error_number is equal to 1 then
			display alert ("Alert!") message "Second check appears okay"
		end if
	end try
end testForFlashbackTrojan

on rebuildLaunchServicesDB()
	display alert ("Alert!") message "The Finder must be quit and will relaunch when complete."

	try
		tell application "Finder" to quit
		do shell script "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user"
		tell application "Finder" to activate

	end try
end rebuildLaunchServicesDB

on reinstallDefaultFakePreferences()
	set TheFile to ((path to me as string) & "Contents:Resources:com.fakeapp.Fake.plist") as alias
	tell application "Finder"
		duplicate TheFile to ((path to preferences folder) as alias) with replacing
	end tell
	set theSetScript to "
#!/bin/bash

defaults delete com.fakeapp.Fake \"FUWindowFrameString\"
defaults delete com.fakeapp.Fake \"NSWindow Frame ActionLibrary\"
defaults delete com.fakeapp.Fake \"NSWindow Frame FUWindow\"
defaults delete com.fakeapp.Fake \"NSWindow Frame Preferences\"
defaults delete com.fakeapp.Fake \"WebDatabaseDirectory\"
defaults write com.fakeapp.Fake \"FakeDelayBetweenRunningActions\" '0'
"
	do shell script theSetScript

end reinstallDefaultFakePreferences

on reinstallFakeWorkflows()
	set oldFolder to (path to application support from user domain as text) & "Fake:Workflows:"
	set fakeFolder to (path to application support from user domain as text) & "Fake:"
	set newFolder to ((path to me as string) & "Contents:Resources:Workflows") as alias
	--	display dialog oldFolder buttons {"OK"}
	tell application "Finder"
		try
			delete oldFolder
		end try
		duplicate newFolder to fakeFolder
	end tell
end reinstallFakeWorkflows

on FlushDNSCache()
	set theSetScript to "

#!/bin/bash

case `/usr/bin/sw_vers -productVersion | /usr/bin/awk -F . '{print $2}'` in
    4) lookupd -flushcache ;;
   [56]) dscacheutil -flushcache ;;
    [78]) sudo killall -HUP mDNSResponder ;;
    9) dscacheutil -flushcache; sudo killall -HUP mDNSResponder ;;
  10) dscacheutil -flushcache; sudo discoveryutil mdnsflushcache ;;
      *) echo \"Unsupported client OS\"; exit 1 ;;
esac

	"
	--if running in 10.7 or 10.8 we need to supply password

	if (osVersion as number > 7) then
		do shell script theSetScript with administrator privileges
	else
		do shell script theSetScript
	end if
end FlushDNSCache

on SystemProfilerReport()

	if (store = "001") then
		set destination to "/Volumes/MHQ/Backed Up/System Profiler Reports/"
		set dest_volume to "afp://mhq-swupdate.local/MHQ"
	else if (store = "002") then
		set destination to "/Volumes/Service/System Profiler Reports/"
		set dest_volume to "afp://xserve.local/Service"
	else if (store = "003") then
		set destination to "/Volumes/Service/System Profiler Reports/"
		set dest_volume to "afp://servercdr.local/Service"
	end if

	--	display dialog oldFolder

	tell application "Finder"
		try
			mount volume dest_volume
		on error
			return "Error mounting server volume \"" & dest_volume & "\". Please connect to server manually and try again."
			tell me to quit
		end try
	end tell

	--this shell script will generate a system profiler report and save it to the server
	do shell script "#!/bin/sh

# the location includes a folder based on the date in yyyy-mm-dd format
report_location=\"" & destination & "`date \"+%Y-%m-%d\"`/\"

if [ ! -d \"${report_location}\" ]; then
	mkdir \"${report_location}\"
fi

serial=`system_profiler SPHardwareDataType | grep \"Serial Number\" | awk  '{print $4}'`

SPDataTypes=\"SPHardwareDataType SPMemoryDataType SPPowerDataType SPSerialATADataType SPSoftwareDataType SPThunderboltDataType SPUSBDataType SPAirPortDataType SPFireWireDataType SPParallelATADataType SPAudioDataType SPBluetoothDataType SPNetworkDataType\"

system_profiler -xml $SPDataTypes > $report_location$serial\".spx\"
"

end SystemProfilerReport

on UpdateWorkflowsFromServer()

	set destination to POSIX path of ((path to application support from user domain as text) & "Fake:Workflows:")

	if (store = "001") then
		set source to "/Volumes/MHQ/Backed Up/Retail Stuff/Current Workflows/"
		set dest_volume to "afp://mhq-swupdate.local/MHQ"
	else if (store = "002") then
		set source to "/Volumes/Retail/Current Workflows/"
		set dest_volume to "afp://xserve.local/Retail"
	else if (store = "003") then
		set source to "/Volumes/Retail/Current Workflows/"
		set dest_volume to "afp://servercdr.local/Retail"
	end if

	--	display dialog oldFolder buttons {"OK"}

	tell application "Finder"
		try
			mount volume dest_volume
		on error
			return "Error mounting server volume \"" & dest_volume & "\". Please connect to server manually and try again."
			tell me to quit
		end try
	end tell

	try
		set theScript to "
	#!/bin/bash

	/usr/bin/rsync -a '" & source & "' '" & destination & "'
	" --shell script

		do shell script theScript --with administrator privileges
	on error
		return "Error syncronizing folders."
	end try

end UpdateWorkflowsFromServer

on testForShellShockVulnerability()

	set test_1 to "
#!/bin/bash

EXPLOIT_1=`env x='() { :;}; echo vulnerable' bash -c \"echo this is a test\"`
if [ \"${EXPLOIT_1}\" = \"vulnerable\" ]; then
    echo \"Test 1 (CVE-2014-6271):	**** Machine appears to be vulnerable ****\"
else
    echo \"Test 1 (CVE-2014-6271):	Machine doesn't appear to be vulnerable\"
fi
"
	set test_2 to "
#!/bin/bash

EXPLOIT_2=`env X='() { (shellshocker.net)=>\\' bash -c \"echo date\"; cat echo; rm ./echo `
if [ \"${EXPLOIT_2}\" != \"date\" ]; then
    echo \"Test 2 (CVE-2014-7169):	**** Machine appears to be vulnerable ****\"
else
    echo \"Test 2 (CVE-2014-7169):	Machine doesn't appear to be vulnerable\"
fi
"
	set test_3 to "
#!/bin/bash

EXPLOIT_3=`env X=' () { }; echo hello' bash -c 'date'`
if [ \"${EXPLOIT_3}\" = \"hello\" ]; then
    echo \"Test 3 (CVE-??):	**** Machine appears to be vulnerable ****\"
else
    echo \"Test 3 (CVE-??):	Machine doesn't appear to be vulnerable\"
fi

"

	set test_4 to "
#!/bin/bash

EXPLOIT_4=`bash -c 'true <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF' || echo \"CVE-2014-7186 vulnerable, redir_stack\"`
if [ \"${EXPLOIT_4}\" = \"CVE-2014-7186 vulnerable, redir_stack\" ]; then
    echo \"Test 4 (CVE-2014-7186):	**** Machine appears to be vulnerable ****\"
else
    echo \"Test 4 (CVE-2014-7186):	Machine doesn't appear to be vulnerable\"
fi

"

	set test_5 to "
#!/bin/bash

EXPLOIT_5=`(for x in {1..200} ; do echo \"for x$x in ; do :\"; done; for x in {1..200} ; do echo done ; done) | bash || echo \"CVE-2014-7187 vulnerable, word_lineno\"`
if [ \"${EXPLOIT_5}\" = \"CVE-2014-7187 vulnerable, word_lineno\" ]; then
    echo \"Test 5 (CVE-2014-7187):	**** Machine appears to be vulnerable ****\"
else
    echo \"Test 5 (CVE-2014-7187):	Machine doesn't appear to be vulnerable\"
fi

"
	set test_6 to "
#!/bin/bash

EXPLOIT_6=`shellshocker='() { echo You are vulnerable; }' bash -c shellshocker`
if [ \"${EXPLOIT_6}\" = \"You are vulnerable\" ]; then
    echo \"Test 6 (CVE-2014-6278):	**** Machine appears to be vulnerable ****\"
else
    echo \"Test 6 (CVE-2014-6278):	Machine doesn't appear to be vulnerable\"
fi

"
	set test_7 to "
#!/bin/bash

EXPLOIT_7=`bash -c \"f() { x() { _;}; x() { _;} <<a; }\" 2>/dev/null || echo vulnerable`
if [ \"${EXPLOIT_7}\" = \"vulnerable\" ]; then
    echo \"Test 7 (CVE-2014-6277):	**** Machine appears to be vulnerable ****\"
else
    echo \"Test 7 (CVE-2014-6277):	Machine doesn't appear to be vulnerable\"
fi

"

	set result_1 to do shell script test_1
	set result_2 to do shell script test_2
	set result_3 to do shell script test_3
	set result_4 to do shell script test_4
	set result_5 to do shell script test_5
	set result_6 to do shell script test_6
	set result_7 to do shell script test_7

	try
		display dialog result_1 & return & result_2 & return & result_3 & return & result_4 & return & result_6 & return & result_6 & return & result_7 & return buttons {"OK"}
	end try
end testForShellShockVulnerability

-- This is the master machq script to replace all others!
-- First find out the version of OS X

global osVersion
global externalIP
global SWUpdateServer
global store

set osVersion to do shell script "/usr/bin/sw_vers -productVersion | /usr/bin/awk -F . '{print $2}'"

try
	set externalIP to do shell script "/usr/bin/curl http://icanhazip.com/"

	set test1 to do shell script "/usr/bin/dig +short 001.machq.com"
	set test2 to do shell script "/usr/bin/dig +short 002.machq.com"
	set test3 to do shell script "/usr/bin/dig +short 003.machq.com"

	if externalIP is test1 then
		set store to "001"
		set SWUpdateServer to "mhq-swupdate.local:8088"
	else if externalIP is test2 then
		set store to "002"
		set SWUpdateServer to "xserve.local:8088"
	else if externalIP is test3 then
		set store to "003"
		set SWUpdateServer to "servercdr.local:8088"
	end if

on error
	--can't determine which store automatically
	set theStoreList to {"St. Louis", "O'Fallon", "Cedar Rapids"}
	set theStore to choose from list theStoreList with title "Help!" with prompt "Where are we?"

	if theStore as string is "St. Louis" then
		set SWUpdateServer to "mhq-swupdate.local:8088"
	else if theStore as string is "O'Fallon" then
		set SWUpdateServer to "xserve.local:8088"
	else if theStore as string is "Cedar Rapids" then
		set SWUpdateServer to "servercdr.local:8088"
	end if

end try

display dialog osVersion buttons {"OK"}

display dialog SWUpdateServer buttons {"OK"}

set theButtonNames to {"Set Used Prefs (all *'ed items)", "Set SWUpdateServer*", "List SWUpdateServer", "Remove SWUpdateServer", "Set MacHQ homepage*", "Disable Sleep*", "Rename HD by Size*", "Install MHQ Reset Script", "Remove Current User & Reset CPU", "Install Tech User Reset Script", "Test for Flashback Trojan", "Test for ShellShock vulnerability", "Rebuild Launch Services DB", "Flush DNS Cache", "Reinstall default Fake preferences", "Update Fake Workflows from Server", "Install SWUpdate StartupItem", "Save System Profiler Report to server"}

repeat
	set theChoice to choose from list theButtonNames
	if theChoice is false then
		exit repeat
	else if theChoice as string is "Set SWUpdateServer*" then
		setSWUpdateServer()
	else if theChoice as string is "List SWUpdateServer" then
		listSWUpdateServer()
	else if theChoice as string is "Remove SWUpdateServer" then
		resetSWUpdateServer()
	else if theChoice as string is "Set MacHQ homepage*" then
		setHomePage()
	else if theChoice as string is "Set Used Prefs (all *'ed items)" then
		setUsedPrefs()
	else if theChoice as string is "Disable Sleep*" then
		disableSleep()
	else if theChoice as string is "Rename HD by Size*" then
		renameHDbySize()
	else if theChoice as string is "Install MHQ Reset Script" then
		installResetScript()
	else if theChoice as string is "Remove MHQ User & Reset CPU" then
		if resetUserCPU() = -128 then
			return
		end if
	else if theChoice as string is "Remove Current User & Reset CPU" then
		if resetThisUserCPU() = -128 then
			return
		end if
	else if theChoice as string is "Install Tech User Reset Script" then
		installTechResetScript()
	else if theChoice as string is "Test for Flashback Trojan" then
		testForFlashbackTrojan()
	else if theChoice as string is "Rebuild Launch Services DB" then
		rebuildLaunchServicesDB()
	else if theChoice as string is "Reinstall default Fake preferences" then
		reinstallDefaultFakePreferences()
	else if theChoice as string is "Reinstall Fake Workflows" then
		reinstallFakeWorkflows()
	else if theChoice as string is "Install SWUpdate StartupItem" then
		InstallSWUpdatePlist()
	else if theChoice as string is "Flush DNS Cache" then
		FlushDNSCache()
	else if theChoice as string is "Save System Profiler Report to server" then
		SystemProfilerReport()
	else if theChoice as string is "Update Fake Workflows from Server" then
		UpdateWorkflowsFromServer()
	else if theChoice as string is "Test for ShellShock vulnerability" then
		testForShellShockVulnerability()
	else
		tell me to quit
	end if

end repeat

on setUsedPrefs()
	disableSleep()
	setSWUpdateServer()
	setHomePage()
	renameHDbySize()
end setUsedPrefs

on setHomePage()
	set fileTarget to (path to library folder from user domain as text) & "Preferences:com.apple.Safari.plist"

	try
		-- we don't really need the alias; we're just checking to see if it exists
		fileTarget as alias
	on error
		tell application "Safari"
			activate
		end tell
	end try
	if running of application "Safari" then
		tell application "Safari"
			quit
		end tell
		repeat while (running of application "Safari")
			delay 1
		end repeat
		delay 2
	end if
	do shell script "defaults write com.apple.Safari HomePage http://twitter.com/machq; defaults write com.apple.Safari NewWindowBehavior 0"
	delay 2
	tell application "Safari"
		activate
		delay 2
		close every window
		quit
	end tell
end setHomePage

on listSWUpdateServer()
	try
		set server_name to do shell script "defaults read /Library/Preferences/com.apple.SoftwareUpdate CatalogURL"
		display dialog "SW update server is: " & server_name buttons {"OK"}
	on error
		display dialog "Using default Apple SW Update Server" buttons {"OK"}
	end try
end listSWUpdateServer

on resetSWUpdateServer()
	try
		--if running in 10.7 or later we need to supply password

		if (osVersion as number > 7) then
			do shell script "defaults delete /Library/Preferences/com.apple.SoftwareUpdate CatalogURL" with administrator privileges
		else
			do shell script "/usr/bin/defaults delete /Library/Preferences/com.apple.SoftwareUpdate CatalogURL"
		end if

		--do shell script "defaults delete /Library/Preferences/com.apple.SoftwareUpdate CatalogURL"
	end try
end resetSWUpdateServer

on disableSleep()
	try
		do shell script "pmset -c displaysleep 0 sleep 0 disksleep 0" with administrator privileges
	end try
end disableSleep

on renameHDbySize()
	set theSetScript to "

#!/bin/bash

boot_vol=`bless --getBoot`

boot_disk=`diskutil info ${boot_vol} |sed '/^ *Volume Name: */!d;s###'`

disk_size=`system_profiler SPSerialATADataType |sed '/^ *Capacity: */!d;s###' | awk '{print int($1+0.5)  $2\" HD\"}' | head -n 1 `

diskutil rename \"${boot_disk}\" \"${disk_size}\"

# Show icons for hard drives, servers, and removable media on the desktop
#defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
#defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
#defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true

killall Finder

"
	do shell script theSetScript

end renameHDbySize

on setSWUpdateServer()

	set theSetScript to "

#!/bin/bash

URL1='http://" & SWUpdateServer & "'
    case `/usr/bin/sw_vers -productVersion | /usr/bin/awk -F . '{print $2}'` in
      4) URL=\"${URL1}/index.sucatalog\" ;;
      5) URL=\"${URL1}/index-leopard.merged-1.sucatalog\" ;;
      6) URL=\"${URL1}/index-leopard-snowleopard.merged-1.sucatalog\" ;;
	7) URL=\"${URL1}/index-lion-snowleopard-leopard.merged-1.sucatalog\" ;;
	8) URL=\"${URL1}/index-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog\" ;;
	9) URL=\"${URL1}/index-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog\" ;;
	10) URL=\"${URL1}/index-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog\" ;;
      *) echo \"Unsupported client OS\"; exit 1 ;;
    esac

/usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL \"${URL}\"

	"
	--if running in 10.7 or 10.8 we need to supply password
	try
		if (osVersion as number > 7) then
			do shell script theSetScript with administrator privileges
		else
			do shell script theSetScript
		end if
	end try
end setSWUpdateServer

on installResetScript()
	try
		set TheFile to ((path to me as string) & "Contents:Resources:mhqreset.sh") as alias
		tell application "Finder"
			duplicate TheFile to the startup disk with replacing
		end tell
	end try
end installResetScript

on resetUserCPU()
	try
		display dialog "This will install the MHQ reset script and restart the computer into single user mode, then run the reset script automatically. Do you wish to continue?" buttons {"Quit", "Continue"} default button "Continue" cancel button "Quit"
		installResetScript()

		if osVersion is "10" then
			set target_file to ".bashrc"
		else
			set target_file to ".profile"
		end if

		do shell script "echo \"sh /mhqreset.sh\" >> /private/var/root/" & target_file with administrator privileges

		do shell script "nvram boot-args=\"-s\"" with administrator privileges

		tell application "Finder" to restart
		return -128
	end try
end resetUserCPU

on resetThisUserCPU()
	try
		tell application "System Events"
			set current_user to get the name of current user
		end tell

		display dialog "This will install the MHQ reset script and restart the computer into single user mode, then run the reset script automatically. The user \"" & current_user & "\" will be deleted with all it's files. Do you wish to continue?" buttons {"Quit", "Continue"} default button "Continue" cancel button "Quit"
		display dialog "Are you absolutely certain?. The user \"" & current_user & "\" will be deleted with all it's files. Do you wish to continue?" buttons {"Quit", "Continue"} default button "Continue" cancel button "Quit"
		installResetScript()

		if osVersion is "10" then
			set target_file to ".bashrc"
		else
			set target_file to ".profile"
		end if

		do shell script "echo \"sh /mhqreset.sh\" " & current_user & " >> /private/var/root/" & target_file with administrator privileges

		do shell script "nvram boot-args=\"-s\"" with administrator privileges

		tell application "Finder" to restart
		return -128
	end try
end resetThisUserCPU

on installTechResetScript()
	set TheFile to ((path to me as string) & "Contents:Resources:techreset.sh") as alias
	tell application "Finder"
		duplicate TheFile to the startup disk with replacing
	end tell

end installTechResetScript

on InstallSWUpdatePlist()

	set TheFile to ((path to me as string) & "Contents:Resources:Set SWUpdate Server") as alias

	if (osVersion as number > 7) then

		tell application "Finder"
			duplicate TheFile to (path to startup items from local domain as alias) with replacing
		end tell
	else

		set theScript to "

		#!/bin/bash

		if [ ! -e '/Library/StartupItems/Set SWUpdate Server' ]; then
		    mkdir '/Library/StartupItems/Set SWUpdate Server'
		fi
		cp -R '" & (the POSIX path of TheFile) & "' '/Library/StartupItems/Set SWUpdate Server/.'
		"
		do shell script theScript with administrator privileges

	end if

	do shell script "chmod -R 755 '/Library/StartupItems/Set SWUpdate Server'; sudo chown -R root:wheel '/Library/StartupItems/Set SWUpdate Server'" with administrator privileges

end InstallSWUpdatePlist

on testForFlashbackTrojan()
	display alert ("Beginning test") message "Testing for presence of Flashback trojan. Keep in mind this is NOT a definitive test!"

	try
		set check1 to do shell script "defaults read /Applications/Safari.app/Contents/Info LSEnvironment"
		display alert ("Possible infection!") message "Recommend running full antivirus scan with up to date scanner. Please note this test is a first release and may produce false positives."

	on error error_message number error_number
		if error_number is equal to 1 then
			display alert ("Alert!") message "First check appears okay"
		end if
	end try

	try
		set check2 to do shell script "defaults read ~/.MacOSX/environment DYLD_INSERT_LIBRARIES"
		display alert ("Possible infection!") message "Recommend running full antivirus scan with up to date scanner. Please note this test is a first release and may produce false positives."

	on error error_message number error_number
		if error_number is equal to 1 then
			display alert ("Alert!") message "Second check appears okay"
		end if
	end try
end testForFlashbackTrojan

on rebuildLaunchServicesDB()
	display alert ("Alert!") message "The Finder must be quit and will relaunch when complete."

	try
		tell application "Finder" to quit
		do shell script "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user"
		tell application "Finder" to activate

	end try
end rebuildLaunchServicesDB

on reinstallDefaultFakePreferences()
	set TheFile to ((path to me as string) & "Contents:Resources:com.fakeapp.Fake.plist") as alias
	tell application "Finder"
		duplicate TheFile to ((path to preferences folder) as alias) with replacing
	end tell
	set theSetScript to "
#!/bin/bash

defaults delete com.fakeapp.Fake \"FUWindowFrameString\"
defaults delete com.fakeapp.Fake \"NSWindow Frame ActionLibrary\"
defaults delete com.fakeapp.Fake \"NSWindow Frame FUWindow\"
defaults delete com.fakeapp.Fake \"NSWindow Frame Preferences\"
defaults delete com.fakeapp.Fake \"WebDatabaseDirectory\"
defaults write com.fakeapp.Fake \"FakeDelayBetweenRunningActions\" '0'
"
	do shell script theSetScript

end reinstallDefaultFakePreferences

on reinstallFakeWorkflows()
	set oldFolder to (path to application support from user domain as text) & "Fake:Workflows:"
	set fakeFolder to (path to application support from user domain as text) & "Fake:"
	set newFolder to ((path to me as string) & "Contents:Resources:Workflows") as alias
	--	display dialog oldFolder buttons {"OK"}
	tell application "Finder"
		try
			delete oldFolder
		end try
		duplicate newFolder to fakeFolder
	end tell
end reinstallFakeWorkflows

on FlushDNSCache()
	set theSetScript to "

#!/bin/bash

case `/usr/bin/sw_vers -productVersion | /usr/bin/awk -F . '{print $2}'` in
    4) lookupd -flushcache ;;
   [56]) dscacheutil -flushcache ;;
    [78]) sudo killall -HUP mDNSResponder ;;
    9) dscacheutil -flushcache; sudo killall -HUP mDNSResponder ;;
  10) dscacheutil -flushcache; sudo discoveryutil mdnsflushcache ;;
      *) echo \"Unsupported client OS\"; exit 1 ;;
esac

	"
	--if running in 10.7 or 10.8 we need to supply password

	if (osVersion as number > 7) then
		do shell script theSetScript with administrator privileges
	else
		do shell script theSetScript
	end if
end FlushDNSCache

on SystemProfilerReport()

	if (store = "001") then
		set destination to "/Volumes/MHQ/Backed Up/System Profiler Reports/"
		set dest_volume to "afp://mhq-swupdate.local/MHQ"
	else if (store = "002") then
		set destination to "/Volumes/Service/System Profiler Reports/"
		set dest_volume to "afp://xserve.local/Service"
	else if (store = "003") then
		set destination to "/Volumes/Service/System Profiler Reports/"
		set dest_volume to "afp://servercdr.local/Service"
	end if

	--	display dialog oldFolder

	tell application "Finder"
		try
			mount volume dest_volume
		on error
			return "Error mounting server volume \"" & dest_volume & "\". Please connect to server manually and try again."
			tell me to quit
		end try
	end tell

	--this shell script will generate a system profiler report and save it to the server
	do shell script "#!/bin/sh

# the location includes a folder based on the date in yyyy-mm-dd format
report_location=\"" & destination & "`date \"+%Y-%m-%d\"`/\"

if [ ! -d \"${report_location}\" ]; then
	mkdir \"${report_location}\"
fi

serial=`system_profiler SPHardwareDataType | grep \"Serial Number\" | awk  '{print $4}'`

SPDataTypes=\"SPHardwareDataType SPMemoryDataType SPPowerDataType SPSerialATADataType SPSoftwareDataType SPThunderboltDataType SPUSBDataType SPAirPortDataType SPFireWireDataType SPParallelATADataType SPAudioDataType SPBluetoothDataType SPNetworkDataType\"

system_profiler -xml $SPDataTypes > $report_location$serial\".spx\"
"

end SystemProfilerReport

on UpdateWorkflowsFromServer()

	set destination to POSIX path of ((path to application support from user domain as text) & "Fake:Workflows:")

	if (store = "001") then
		set source to "/Volumes/MHQ/Backed Up/Retail Stuff/Current Workflows/"
		set dest_volume to "afp://mhq-swupdate.local/MHQ"
	else if (store = "002") then
		set source to "/Volumes/Retail/Current Workflows/"
		set dest_volume to "afp://xserve.local/Retail"
	else if (store = "003") then
		set source to "/Volumes/Retail/Current Workflows/"
		set dest_volume to "afp://servercdr.local/Retail"
	end if

	--	display dialog oldFolder buttons {"OK"}

	tell application "Finder"
		try
			mount volume dest_volume
		on error
			return "Error mounting server volume \"" & dest_volume & "\". Please connect to server manually and try again."
			tell me to quit
		end try
	end tell

	try
		set theScript to "
	#!/bin/bash

	/usr/bin/rsync -a '" & source & "' '" & destination & "'
	" --shell script

		do shell script theScript --with administrator privileges
	on error
		return "Error syncronizing folders."
	end try

end UpdateWorkflowsFromServer

on testForShellShockVulnerability()

	set test_1 to "
#!/bin/bash

EXPLOIT_1=`env x='() { :;}; echo vulnerable' bash -c \"echo this is a test\"`
if [ \"${EXPLOIT_1}\" = \"vulnerable\" ]; then
    echo \"Test 1 (CVE-2014-6271):	**** Machine appears to be vulnerable ****\"
else
    echo \"Test 1 (CVE-2014-6271):	Machine doesn't appear to be vulnerable\"
fi
"
	set test_2 to "
#!/bin/bash

EXPLOIT_2=`env X='() { (shellshocker.net)=>\\' bash -c \"echo date\"; cat echo; rm ./echo `
if [ \"${EXPLOIT_2}\" != \"date\" ]; then
    echo \"Test 2 (CVE-2014-7169):	**** Machine appears to be vulnerable ****\"
else
    echo \"Test 2 (CVE-2014-7169):	Machine doesn't appear to be vulnerable\"
fi
"
	set test_3 to "
#!/bin/bash

EXPLOIT_3=`env X=' () { }; echo hello' bash -c 'date'`
if [ \"${EXPLOIT_3}\" = \"hello\" ]; then
    echo \"Test 3 (CVE-??):	**** Machine appears to be vulnerable ****\"
else
    echo \"Test 3 (CVE-??):	Machine doesn't appear to be vulnerable\"
fi

"

	set test_4 to "
#!/bin/bash

EXPLOIT_4=`bash -c 'true <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF' || echo \"CVE-2014-7186 vulnerable, redir_stack\"`
if [ \"${EXPLOIT_4}\" = \"CVE-2014-7186 vulnerable, redir_stack\" ]; then
    echo \"Test 4 (CVE-2014-7186):	**** Machine appears to be vulnerable ****\"
else
    echo \"Test 4 (CVE-2014-7186):	Machine doesn't appear to be vulnerable\"
fi

"

	set test_5 to "
#!/bin/bash

EXPLOIT_5=`(for x in {1..200} ; do echo \"for x$x in ; do :\"; done; for x in {1..200} ; do echo done ; done) | bash || echo \"CVE-2014-7187 vulnerable, word_lineno\"`
if [ \"${EXPLOIT_5}\" = \"CVE-2014-7187 vulnerable, word_lineno\" ]; then
    echo \"Test 5 (CVE-2014-7187):	**** Machine appears to be vulnerable ****\"
else
    echo \"Test 5 (CVE-2014-7187):	Machine doesn't appear to be vulnerable\"
fi

"
	set test_6 to "
#!/bin/bash

EXPLOIT_6=`shellshocker='() { echo You are vulnerable; }' bash -c shellshocker`
if [ \"${EXPLOIT_6}\" = \"You are vulnerable\" ]; then
    echo \"Test 6 (CVE-2014-6278):	**** Machine appears to be vulnerable ****\"
else
    echo \"Test 6 (CVE-2014-6278):	Machine doesn't appear to be vulnerable\"
fi

"
	set test_7 to "
#!/bin/bash

EXPLOIT_7=`bash -c \"f() { x() { _;}; x() { _;} <<a; }\" 2>/dev/null || echo vulnerable`
if [ \"${EXPLOIT_7}\" = \"vulnerable\" ]; then
    echo \"Test 7 (CVE-2014-6277):	**** Machine appears to be vulnerable ****\"
else
    echo \"Test 7 (CVE-2014-6277):	Machine doesn't appear to be vulnerable\"
fi

"

	set result_1 to do shell script test_1
	set result_2 to do shell script test_2
	set result_3 to do shell script test_3
	set result_4 to do shell script test_4
	set result_5 to do shell script test_5
	set result_6 to do shell script test_6
	set result_7 to do shell script test_7

	try
		display dialog result_1 & return & result_2 & return & result_3 & return & result_4 & return & result_6 & return & result_6 & return & result_7 & return buttons {"OK"}
	end try
end testForShellShockVulnerability


corrected one shortcuts

corrected one shortcuts

tell application "System Preferences"
	activate
	set current pane to pane "com.apple.preference.keyboard"
	reveal anchor "shortcutsTab" of pane id "com.apple.preference.keyboard"
	-- Incase the window is not opened instantly
	delay 1
end tell
tell application "System Events"
	tell application process "System Preferences"
		tell splitter group 1 of tab group 1 of window "Keyboard"
			set selected of row 9 of table 1 of scroll area 1 to true
		end tell
		-- Click the "Add" button in the window "Keyboard"
		click button 1 of group 1 of tab group 1 of window "Keyboard"
		-- Choose the Target Application
		tell pop up button 1 of sheet 1 of window "Keyboard"
			click
			tell menu 1
				click menu item "Xcode"
			end tell
		end tell
		-- Set the shortcut title
		set value of text field 1 of sheet 1 of window "Keyboard" to "Highlight Occurences of Symbol"
		-- Move the focus into the "Keyboard Shortcut" text field
		keystroke tab
		-- The key code of "F11" is 103
		key code 103 using {shift down, command down}
		-- Confirm and add the shortcut
		click button "Add" of sheet 1 of window "Keyboard"

		-- Now the application is default to Xcode,
		-- so go straight for the remaining shortcuts
		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Highlight Occurences of String"
		keystroke tab
		key code 111 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Highlight Regex Matches"
		keystroke tab
		key code 103 using {control down, option down, shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Remove Most Recently Added Highlight"
		keystroke tab
		key code 109 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Remove All Highlighting"
		keystroke tab
		key code 101 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		-- The Methods group
		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Select Methods and Functions"
		keystroke tab
		key code 46 using {option down, shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Select Method and Function Signatures"
		keystroke tab
		key code 46 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Duplicate Methods and Functions"
		keystroke tab
		key code 2 using {option down, shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Copy Method and Function Declarations"
		keystroke tab
		key code 8 using {option down, shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"
		-- The Lines group
		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Cut Lines"
		keystroke tab
		key code 7 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Copy Lines"
		keystroke tab
		key code 8 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Paste Lines"
		keystroke tab
		key code 9 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Paste Lines Without Reindent"
		keystroke tab
		key code 9 using {option down, shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Duplicate Lines"
		keystroke tab
		key code 2 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Delete Lines"
		keystroke tab
		key code 37 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"
	end tell
end tell
tell application "System Preferences" to quit

tell application "System Preferences"
	activate
	set current pane to pane "com.apple.preference.keyboard"
	reveal anchor "shortcutsTab" of pane id "com.apple.preference.keyboard"
	-- Incase the window is not opened instantly
	delay 1
end tell
tell application "System Events"
	tell application process "System Preferences"
		tell splitter group 1 of tab group 1 of window "Keyboard"
			set selected of row 9 of table 1 of scroll area 1 to true
		end tell
		-- Click the "Add" button in the window "Keyboard"
		click button 1 of group 1 of tab group 1 of window "Keyboard"
		-- Choose the Target Application
		tell pop up button 1 of sheet 1 of window "Keyboard"
			click
			tell menu 1
				click menu item "Xcode"
			end tell
		end tell
		-- Set the shortcut title
		set value of text field 1 of sheet 1 of window "Keyboard" to "Highlight Occurences of Symbol"
		-- Move the focus into the "Keyboard Shortcut" text field
		keystroke tab
		-- The key code of "F11" is 103
		key code 103 using {shift down, command down}
		-- Confirm and add the shortcut
		click button "Add" of sheet 1 of window "Keyboard"

		-- Now the application is default to Xcode,
		-- so go straight for the remaining shortcuts
		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Highlight Occurences of String"
		keystroke tab
		key code 111 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Highlight Regex Matches"
		keystroke tab
		key code 103 using {control down, option down, shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Remove Most Recently Added Highlight"
		keystroke tab
		key code 109 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Remove All Highlighting"
		keystroke tab
		key code 101 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		-- The Methods group
		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Select Methods and Functions"
		keystroke tab
		key code 46 using {option down, shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Select Method and Function Signatures"
		keystroke tab
		key code 46 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Duplicate Methods and Functions"
		keystroke tab
		key code 2 using {option down, shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Copy Method and Function Declarations"
		keystroke tab
		key code 8 using {option down, shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"
		-- The Lines group
		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Cut Lines"
		keystroke tab
		key code 7 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Copy Lines"
		keystroke tab
		key code 8 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Paste Lines"
		keystroke tab
		key code 9 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Paste Lines Without Reindent"
		keystroke tab
		key code 9 using {option down, shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Duplicate Lines"
		keystroke tab
		key code 7 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"

		click button 1 of group 1 of tab group 1 of window "Keyboard"
		set value of text field 1 of sheet 1 of window "Keyboard" to "Delete Lines"
		keystroke tab
		key code 37 using {shift down, command down}
		click button "Add" of sheet 1 of window "Keyboard"
	end tell
end tell
tell application "System Preferences" to quit


fixed missing sub-handlers in fmGUI_ManageDb_Open

-- fmGUI_ManageDb_Open(prefs)
-- Daniel A. Shockley, NYHTC
-- Open Manage Database

(*
HISTORY:
	1.4 - 2020-05-20 ( dshockley ): added multiple missing sub-handlers.
	1.3 - 2018-04-30 ( eshagdar ): get window name via handler.
	1.2 - added xDBC connection error trapping
	1.1 -
	1.0 - created

TODO:
	- 2015-06-03 ( eshagdar ): probably going to need to open manageDB via openManageDB script if the menu item fails

REQUIRES:
	fmGUI_AppFrontMost
	fmGUI_ManageDb_DismissXDBCDialog
	fmGUI_ManageDb_GoToTab_Relationships
	fmGUI_ManageDb_RelationshipsTab
	fmGUI_Menu_OpenDB
	fmGUI_NameOfFrontmostWindow
*)

on run
	fmGUI_ManageDb_Open({})
end run

--------------------
-- START OF CODE
--------------------

on fmGUI_ManageDb_Open(prefs)
	-- version 1.4

	try
		fmGUI_AppFrontMost()

		-- try to open Manage DB
		set windowName to fmGUI_NameOfFrontmostWindow()
		if windowName starts with "Manage Database for" then
			return true
		else
			fmGUI_Menu_OpenDB({})

			-- dismiss any initial xDBC connection errors
			fmGUI_ManageDb_DismissXDBCDialog({})

			-- go to the TOs tab and AGAIN dismiss any xDBC connections that failed to connect
			fmGUI_ManageDb_GoToTab_Relationships({})
			delay 1
			fmGUI_ManageDb_DismissXDBCDialog({})

			--zoom out to show all TOs and dismiss any xDBC errors that weren't already dismissed
			tell application "System Events"
				tell application process "FileMaker Pro Advanced"
					keystroke "i" using command down
				end tell
			end tell
			delay 1
			fmGUI_ManageDb_DismissXDBCDialog({})

			-- zoom back in
			tell application "System Events"
				tell application process "FileMaker Pro Advanced"
					set zoomField to text field 1 of tab group 1 of window 1
					set focused of zoomField to true
					set value of zoomField to "100"
				end tell
			end tell

			return true
		end if
	on error errMsg number errNum
		error "Couldn't open manage DB - " & errMsg number errNum
	end try

end fmGUI_ManageDb_Open

--------------------
-- END OF CODE
--------------------

on fmGUI_AppFrontMost()
	tell application "htcLib" to fmGUI_AppFrontMost()
end fmGUI_AppFrontMost

on fmGUI_ManageDb_DismissXDBCDialog(prefs)
	tell application "htcLib" to fmGUI_ManageDb_DismissXDBCDialog(prefs)
end fmGUI_ManageDb_DismissXDBCDialog

on fmGUI_ManageDb_GoToTab_Relationships(prefs)
	tell application "htcLib" to fmGUI_ManageDb_GoToTab_Relationships(prefs)
end fmGUI_ManageDb_GoToTab_Relationships

on fmGUI_ManageDb_RelationshipsTab(prefs)
	tell application "htcLib" to fmGUI_ManageDb_RelationshipsTab(prefs)
end fmGUI_ManageDb_RelationshipsTab

on fmGUI_Menu_OpenDB(prefs)
	tell application "htcLib" to fmGUI_Menu_OpenDB(prefs)
end fmGUI_Menu_OpenDB

on fmGUI_NameOfFrontmostWindow()
	tell application "htcLib" to fmGUI_NameOfFrontmostWindow()
end fmGUI_NameOfFrontmostWindow

-- fmGUI_ManageDb_Open(prefs)
-- Daniel A. Shockley, NYHTC
-- Open Manage Database

(*
HISTORY:
	1.3 - 2018-04-30 ( eshagdar ): get window name via handler.
	1.2 - added xDBC connection error trapping
	1.1 -
	1.0 - created

TODO:
	- 2015-06-03 ( eshagdar ): probably going to need to open manageDB via openManageDB script if the menu item fails

REQUIRES:
	fmGUI_AppFrontMost
	fmGUI_ManageDb_RelationshipsTab
	fmGUI_NameOfFrontmostWindow
*)

on run
	fmGUI_ManageDb_Open({})
end run

--------------------
-- START OF CODE
--------------------

on fmGUI_ManageDb_Open(prefs)
	-- version 1.3

	try
		fmGUI_AppFrontMost()

		-- try to open Manage DB
		set windowName to fmGUI_NameOfFrontmostWindow()
		if windowName starts with "Manage Database for" then
			return true
		else
			fmGUI_Menu_OpenDB({})

			-- dismiss any initial xDBC connection errors
			fmGUI_ManageDb_DismissXDBCDialog({})

			-- to to the TOs tab and dismiss any xDBC connections that failed to connect
			fmGUI_ManageDb_GoToTab_Relationships({})
			delay 1
			fmGUI_ManageDb_DismissXDBCDialog({})

			--zoom out to show all TOs and dismiss any xDBC errors that weren't already dismissed
			tell application "System Events"
				tell application process "FileMaker Pro Advanced"
					keystroke "i" using command down
				end tell
			end tell
			delay 1
			fmGUI_ManageDb_DismissXDBCDialog({})

			-- zoom back in
			tell application "System Events"
				tell application process "FileMaker Pro Advanced"
					set zoomField to text field 1 of tab group 1 of window 1
					set focused of zoomField to true
					set value of zoomField to "100"
				end tell
			end tell

			return true
		end if
	on error errMsg number errNum
		error "Couldn't open manage DB - " & errMsg number errNum
	end try

end fmGUI_ManageDb_Open

--------------------
-- END OF CODE
--------------------

on fmGUI_AppFrontMost()
	tell application "htcLib" to fmGUI_AppFrontMost()
end fmGUI_AppFrontMost

on fmGUI_ManageDb_RelationshipsTab(prefs)
	tell application "htcLib" to fmGUI_ManageDb_RelationshipsTab(prefs)
end fmGUI_ManageDb_RelationshipsTab

on fmGUI_NameOfFrontmostWindow()
	tell application "htcLib" to fmGUI_NameOfFrontmostWindow()
end fmGUI_NameOfFrontmostWindow


updated iCal AppleScript - better event searching, and warning about missing repeat events

FasdUAS 1.101.10
k
lQK	An applescript that shows today's events from iCal as growl notifications.
l

a[	The script shows how to register and use multiple types of notifications from Applescript:
l

l		"Today's Events"
l			and
l!		"In-Script Notifications"
lD>			are the two notification types that this script registers.
l@: 			The types of notification are separated functionally.
l|v 			So the user can disable the first informational note from the prefpane without disabling the main notifications.
l!!tn-------------------------------------------------------------------------------------------------------------- "#
"l$$tn--------------------------------------------------------------------------------------------------------------#%&
%l&'(
'l()*
)l*+,
+l--A;	Register with growl and show the "gathering" notification.,./
.l20
0O212
1k13345
4l567
6O89
8k::;<
;r=>
=J??@A
@m	BBToday's EventsAC
Cm
DDIn-Script Notification
>o 0myallnoteslistmyAllNotesList<E
EIF
.registernullnullFGH

appl
GmII-'AppleScript iCal today's Event NotifierHJK

anot
Jo 0myallnoteslistmyAllNotesListKLM

dnot
Lo 0myallnoteslistmyAllNotesListMN

iapp
NmOO
iCal
9mPPLnull߀OGrowlHelperApp.appL7@p)(K GRRRalisWideBoy.1H+OGrowlHelperApp.appO)	 	Resources.1)OOO+m|bWideBoy:Users:diggory:Library:PreferencePanes:Growl.prefPane:Contents:Resources:GrowlHelperApp.app&GrowlHelperApp.appWideBoyZUsers/diggory/Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app/7QR
QlRS
SI1T
.notifygrnullnullTUV

name
Ul	 !W
Wm !XXIn-Script NotificationVYZ

titl
Yl	"#[
[m"#\\Please WaitZ]^

desc
]l	&)_
_m&)``^XGathering today's events from iCal... (n.b. Events which are repeats will not be shown!)^a

appl
am*-bb-'AppleScript iCal today's Event Notifier
2mP/cd
cldef
elfgh
glhij
il3<k
kr3<lm
lI38
.misccurdldt null
mo0nowjno
nl=|p
pr=|qr
qc=xst
sl=tu
ub=tvw
vb=pxy
xb=lz{
zb=d|}
|b=`~
~b=X
b=T
b=L
b=H
m=@"
n@G
mCG

wkdy
o@C0now
mHK,
nLS
mOS

mnth
oLO0now
mTW
nX_
1[_

day
oX[0now
}m`c,
{ndk
1gk

year
odg0now
ymlo 12:00:00 am
wmps"
tmtw

TEXT
ro0morningtimemorningTimeo
l}
r}
4}

ldt
o0morningtimemorningTime
o0thismorningthisMorning
l
I
.ascrcmnt********
l
o0thismorningthisMorning
l
r
c
l
b
b
b
b
b
b
b
b
b
m"
n
m

wkdy
o0now
m,
n
m

mnth
o0now
m
n
1

day
o0now
m,
n
1

year
o0now
m 11:59:59 pm
m"
m

TEXT
o0eveningtimeeveningTime
l
r
4

ldt
o0eveningtimeeveningTime
o0thiseveningthisEvening
l
I
.ascrcmnt********
l
o0thiseveningthisEvening
l
l
l	Gather today's events
l
O
k
l
r
2

wres
o0
everycalendar
everyCalendar
l
r
c
J
m

list
o0
currentevents
currentEvents
Y&
k!
r#
n
4

cobj
o0i
o0
everycalendar
everyCalendar
o0thiscalthisCal
l$$
O$!
k*
r*3
2*/

wrev
o0
everyevent
everyEvent
Y4 	~
kI

rIU

nIQ
4LQ}
}
cobj
oOP||0ii
oIL{{0
everyevent
everyEvent
ozz0	thisevent	thisEventy
OV
k\
l\\xwxw
l\\vv$	Catch events that start today
r\a
m\]u
uboovfals
ott 0eventiscurrenteventIsCurrent
Zb!"sr
!Fb{#$
#lbk%q
%?bk&'
&1bgp
p
wr1s
'ogjoo0thismorningthisMorningq
$lnw(n
(Anw)*
)1nsm
m
wr1s
*osvll0thiseveningthisEveningn
"r~+,
+m~k
kboovtrue
,ojj 0eventiscurrenteventIsCurrentsr -.
-lihih./0
/lg1g1F@	Catch events that started before today, but have not yet ended.023
2Z45fe
4F67
6l8d
8?9:
91c
c
wr5s
:obb0nowd
7l;a
;A<=
<1`
`
wr1s
=o__0thismorningthisMorninga
5r>?
>m^
^boovtrue
?o]] 0eventiscurrenteventIsCurrentfe3@A
@l\[\[ABC
BlZYZYCDE
DZFGXW
FlHV
H=IJ
IoUU 0eventiscurrenteventIsCurrent
JmT
TboovtrueV
GkKKLM
LISNR
S.ascrcmnt********
NlOQ
OmPPCURRENT EVENT!QRMQR
QrST
S1P
P
wr1s
ToOO0thestarttheStartRUV
UrWX
WnYZ
Y1N
N
tstr
ZoMM0thestarttheStart
XoLL0thestarttimetheStartTimeV[\
[r]^
]c_`
_KaaKbcK0
eventtitle
eventTitle
bnde
d1J
J
wr11
eoII0	thisevent	thisEventcHfgH$0eventdescriptioneventDescription
fnhi
h1G
G
wr12
ioFF0	thisevent	thisEventgEjDE0	starttime	startTime
joCC0thestarttimetheStartTimeD
`mB
B
reco
^oAA0myrecordmyRecord\kl
krmn
mcop
oJqqr@
ro??0myrecordmyRecord@
pm>
>
list
no==0newlistnewListls<
sr	tu
tb	vw
vo	;;0
currentevents
currentEvents
wo::0newlistnewList
uo990
currentevents
currentEvents<XWExy
xl8787yz6
zl54546
oVY330	thisevent	thisEventy0ii
m7822
	n8D{|
{m?C1
1
nmbr
|n8?}~
}2;?0
0
cobj
~o8;//0
everyevent
everyEvent~
o$'..0thiscalthisCal0i
m--
n
m
,
,
nmbr
n

2
+
+
cobj
o	**0
everycalendar
everyCalendar
l'')()(
l'''&'&
l''%%	Show the events.
Y'$#
k<
r<H
n<D
4?D"
"
cobj
oBC!!0i
o<?  0
currentevents
currentEvents
o"0thiseventrecordthisEventRecord
QIz
rLc
lL_
bL_
bLW
nLS
oOS0
eventtitle
eventTitle
oLO"0thiseventrecordthisEventRecord
mSV	 -
nW^
oZ^0	starttime	startTime
oWZ"0thiseventrecordthisEventRecord
o"0theeventsummarytheEventSummary
R
.ascrerr ********
rkz
bkv
mkn
no summary -
nnu
oqu0	starttime	startTime
onq"0thiseventrecordthisEventRecord
o"0theeventsummarytheEventSummary
l{{
Q{
r~
n~
o$0eventdescriptioneventDescription
o~"0thiseventrecordthisEventRecord
o*0theeventdescriptiontheEventDescription
R

.ascrerr ********
r
mno description
o

*0theeventdescriptiontheEventDescription
l
O
l
I
.notifygrnullnull

name
l
mToday's Events

titl
l
o"0theeventsummarytheEventSummary

desc
l
o*0theeventdescriptiontheEventDescription

appl
m-'AppleScript iCal today's Event Notifier
mP$0i
m*+
n+7
m26

nmbr
n+2
2.2

cobj
o+.0
currentevents
currentEvents#
l
mnull߀^iCal.app`0L7֐0p)(K ְwrbtalis6WideBoy.1H+^iCal.app	 Applications.1^WideBoy:Applications:iCal.appiCal.appWideBoyApplications/iCal.app/
l
l
.aevtoappnull****
.aevtoappnull****
k.in0i0iiSPBDIOX\`bP 0myallnoteslistmyAllNotesList

appl

anot

dnot

iapp
.registernullnull

name

titl

desc
.notifygrnullnull
.misccurdldt null0now

wkdy

mnth

day

year

TEXT0morningtimemorningTime

ldt 0thismorningthisMorning
.ascrcmnt********0eveningtimeeveningTime0thiseveningthisEvening

wres0
everycalendar
everyCalendar

list0
currentevents
currentEvents

cobj

nmbr0thiscalthisCal

wrev0
everyevent
everyEvent0	thisevent	thisEvent 0eventiscurrenteventIsCurrent

wr1s

bool

wr5s0thestarttheStart

tstr0thestarttimetheStartTime0
eventtitle
eventTitle

wr11$0eventdescriptioneventDescription

wr120	starttime	startTime

reco0myrecordmyRecord0newlistnewList"0thiseventrecordthisEventRecord"0theeventsummarytheEventSummary*0theeventdescriptiontheEventDescription/lvEO*UO*aaaUO*jE`Oa_a,%a%_a,%a%_a,%a%_a,%a%a%a &E`!O*a"_!/E`#O_#j$Oa%_a,%a&%_a,%a'%_a,%a(%_a,%a)%a*%a &E`+O*a"_+/E`,O_,j$Oa-*a.-E`/Ojva0&E`1O#k_/a2-a3,Ekh_/a2/E`4O_4*a5-E`6Ok_6a2-a3,Ekh_6a2/E`7O_7fE`8O*a9,_#	*a9,_,a:&
eE`8YhO*a;,_	*a9,_#a:&
eE`8YhO_8eca<j$O*a9,E`=O_=a>,E`?Oa@_7aA,aB_7aC,aD_?aEaF&E`GO_Gkva0&E`HO_1_H%E`1YhOPU[OY(U[OYOk_1a2-a3,Ekh_1a2/E`IO_Ia@,aJ%_IaD,%E`KWXLMaN_IaD,%E`KO_IaB,E`OWXLMaPE`OO*aQ_Ka_OaRU[OYOPUascr
ޭ

FasdUAS 1.101.10
k
lQK	An applescript that shows today's events from iCal as growl notifications.
l

a[	The script shows how to register and use multiple types of notifications from Applescript:
l

l		"Today's Events"
l			and
l!		"In-Script Notifications"
lD>			are the two notification types that this script registers.
l@: 			The types of notification are separated functionally.
l|v 			So the user can disable the first informational note from the prefpane without disabling the main notifications.
l!!tn-------------------------------------------------------------------------------------------------------------- "#
"l$$tn--------------------------------------------------------------------------------------------------------------#%&
%l&'(
'l()*
)l*+,
+l--A;	Register with growl and show the "gathering" notification.,./
.l20
0O212
1k13345
4l567
6O89
8k::;<
;r=>
=J??@A
@m	BBToday's EventsAC
Cm
DDIn-Script Notification
>o 0myallnoteslistmyAllNotesList<E
EIF
.registernullnullFGH

appl
GmII-'AppleScript iCal today's Event NotifierHJK

anot
Jo 0myallnoteslistmyAllNotesListKLM

dnot
Lo 0myallnoteslistmyAllNotesListMN

iapp
NmOO
iCal
9mPPnull߀OGrowlHelperApp.appL7p)(K GRRRalisWideBoy.1H+OGrowlHelperApp.appO{&݇	 build.1&݇ON>//|DWideBoy:Users:diggory:Code:OpenSource:growl:build:GrowlHelperApp.app&GrowlHelperApp.appWideBoy<Users/diggory/Code/OpenSource/growl/build/GrowlHelperApp.app/7QR
QlRS
SI1T
.notifygrnullnullTUV

name
Ul	 !W
Wm !XXIn-Script NotificationVYZ

titl
Yl	"#[
[m"#\\Please WaitZ]^

desc
]l	&)_
_m&)``+%Gathering today's events from iCal...^a

appl
am*-bb-'AppleScript iCal today's Event Notifier
2mP/cd
cldef
elfgh
glhij
iljkl
klmm	Gather today's eventslno
nl3p
pO3qr
qk9sstu
tr9Bvw
vI9>
.misccurdldt null
wo0nowuxy
xrCLz{
z2CH

wres
{o0
everycalendar
everyCalendary|}
|lMM}~
~rMW
cMS
JMO
mOR

list
o0
currentevents
currentEvents
YX
km
rmy
nmu
4pu

cobj
ost0i
omp0
everycalendar
everyCalendar
o0thiscalthisCal
lzz
Oz
k
r
2

wrev
o0
everyevent
everyEvent
Y
k

r
n
4

cobj
o0ii
o0
everyevent
everyEvent
o0	thisevent	thisEvent
O

k
l
Z
A
1

wr1s
o0now
Z
?
1

wr5s
o0now
k
l#	This checking is pretty bad
lB<    events today that have already elapsed are not included.
l
l$	log ("CURRENT EVENT!")
r
c
K0
eventtitle
eventTitle
n
1

wr11
o0	thisevent	thisEvent$0eventdescriptioneventDescription
n
1

wr12
o0	thisevent	thisEvent
m

reco
o0myrecordmyRecord
r
c
J
o0myrecordmyRecord
m

list
o0newlistnewList
r
b
o0
currentevents
currentEvents
o0newlistnewList
o0
currentevents
currentEvents
o0	thisevent	thisEvent0ii
m
n
m

nmbr
n
2

cobj
o0
everyevent
everyEvent
oz}0thiscalthisCal0i
m[\
n\h
mcg

nmbr
n\c
2_c~
~
cobj
o\_}}0
everycalendar
everyCalendar
l|{|{
lzyzy
lxx	Show the events.
Ywv
k.
r.:
n.6
416u
u
cobj
o45tt0i
o.1ss0
currentevents
currentEvents
orr"0thiseventrecordthisEventRecord
Q;X
r>I
n>E
oAEqq0
eventtitle
eventTitle
o>App"0thiseventrecordthisEventRecord
ooo"0theeventsummarytheEventSummary
Rnml
n.ascrerr ********ml
rQX
mQT
no summary
okk"0theeventsummarytheEventSummary
lYYjiji
QYv

	r\g

n\c
o_chh$0eventdescriptioneventDescription
o\_gg"0thiseventrecordthisEventRecord

off*0theeventdescriptiontheEventDescription

Redc
e.ascrerr ********dc
rov
morno description
obb*0theeventdescriptiontheEventDescription
lwwa`a`_
Ow
l	{^
I{]\
].notifygrnullnull\[
[
name
l	}Z
m}Today's EventsZY
Y
titl
l	 X
 oWW"0theeventsummarytheEventSummaryXV!"
V
desc
!l	#U
#oTT*0theeventdescriptiontheEventDescriptionU"S$R
S
appl
$m%%-'AppleScript iCal today's Event NotifierR^
mwxP_w0i
mQQ
n)&'
&m$(P
P
nmbr
'n$()
(2 $O
O
cobj
)o NN0
currentevents
currentEventsv*+
*lMLML+,-
,lKJKJ-./
.lI0I0#	explain if there aren't any:/12
1lHGHG234
3Z56FE
5=78
7l9D
9n:;
:mC
C
nmbr
;n<=
<2B
B
cobj
=oAA0
currentevents
currentEventsD
8m@@
6k>>?@
?OAB
Al	C?
CI>=D
>.notifygrnullnull=D<EF
<
name
El	G;
GmHHIn-Script Notification;F:IJ
:
titl
Il	K9
KmLL	No Events9J8MN
8
desc
Ml	O7
OmPP>8There are no events in iCal today - go outside and play!7N6Q5
6
appl
QmRR-'AppleScript iCal today's Event Notifier5?
BmP@S4
Sl32324FE4T1
Tl0/0/1
rm36UUnull߀^iCal.appPP0`U0e(-lwrbtalis6WideBoy.1H+^iCal.app	 Applications.1^WideBoy:Applications:iCal.appiCal.appWideBoyApplications/iCal.app/oVW
Vl.-.-WX,
Xl+*+*,)YZ)Y(
(.aevtoappnull****Z'[&%\]$
'.aevtoappnull****
[k^^.__n##&%\"!"0i!0ii]8PBD IOX\`bU

	%HLPR  0myallnoteslistmyAllNotesList

appl

anot

dnot

iapp
.registernullnull

name

titl

desc
.notifygrnullnull
.misccurdldt null0now

wres0
everycalendar
everyCalendar

list0
currentevents
currentEvents

cobj

nmbr
0thiscalthisCal

wrev0
everyevent
everyEvent
0	thisevent	thisEvent

wr1s

wr5s0
eventtitle
eventTitle

wr11$0eventdescriptioneventDescription

wr12

reco0myrecordmyRecord0newlistnewList"0thiseventrecordthisEventRecord"0theeventsummarytheEventSummary*0theeventdescriptiontheEventDescription$/lvEO*UO*aaaUOa*jE`O*a-E`Ojva&E`Ok_a-a,Ekh_a/E`O_*a-E`Ok_a-a,Ekh_a/E` O_ \*a!,_O*a",_?a#_ a$,a%_ a&,a'a(&E`)O_)kva&E`*O__*%E`YhYhU[OYU[OYTO~k_a-a,Ekh_a/E`+O_+a#,E`,WX-.a/E`,O_+a%,E`0WX-.a1E`0O*a2_,a_0a3U[OYO_a-a,j#*a4a5aa6a7UOPYhOPUascrޭ


el capitan script change

el capitan script change

FasdUAS 1.101.10
k
l
r
J

m

puma -p 3000
mJruby script/websocket-server.rb start
m&guard -P livereload
mgulp
	o0commandlistcommandList
l
l
O
k
!!"#
"I

.miscactvnullobj #$
$r%&
%c'(
'l)
)n*+
*1

fvtg
+4,

brow
,m
(m

ctxt
&o0
currentdir
currentDir
 m
--MACSalisrSolid Stone3H+8
Finder.app(	 CoreServices3d8765Solid Stone:System:Library:CoreServices:Finder.app
Finder.appSolid Stone&System/Library/CoreServices/Finder.app/./
.l/01
0l$2
2I$3
.sysodelanullnmbr
3m 145
4l56
6l%7
7O%89
8k)::;<
;I).
.miscactvnullobj <=>
=I/I?@
.coredoscnullctxt
?b/8AB
Ab/4CD
Cm/0EEFFcd
Dl03G
Gn03HI
H113

psxp
Io010
currentdir
currentDir
Bm47JJKK..@L

kfil
Ln;EMN
M1AE

tcnt
Nl;AO
O4;AP

cwin
Pm?@>QR
QlJJRST
SIJOU
.sysodelanullnmbr
UmJKTVW
VlPPWX
XYPYZ[
Yk^\\]^
]Z^_`
_?^aab
ao^_0n
bm_`
`kdccde
dIdif
.sysodelanullnmbr
fmdeeg
gOjhi
hIpjk
.prcskprsnullctxt
jmpsllmmtkn

faal
nJv{oop
pmvy
eMdsKcmd
imjmqqsevsalisSolid Stone3H+8System Events.appl	 CoreServices3d876<Solid Stone:System:Library:CoreServices:System Events.app$System Events.appSolid Stone-System/Library/CoreServices/System Events.app/^rs
rItu
.coredoscnullctxt
tlv
vnwx
w4y

cobj
yo0n
xo0commandlistcommandListuz

kfil
zn{|
{1

tcnt
|l}
}4~

cwin
~ms
I
.sysodelanullnmbr
m0n
ZmST
[ITY
.corecnte********
oTU0commandlistcommandList
9m%&@alisjSolid Stone3H+ITerminal.appB	 	Utilities3d"IW1Solid Stone:Applications:Utilities:Terminal.appTerminal.appSolid Stone#Applications/Utilities/Terminal.app/
.aevtoappnull****0commandlistcommandList0
currentdir
currentDir
.aevtoappnull****
k060n
-EJql0commandlistcommandList
.miscactvnullobj

brow

fvtg

ctxt0
currentdir
currentDir
.sysodelanullnmbr

psxp

kfil

cwin

tcnt
.coredoscnullctxt
.corecnte********

faal
eMdsKcmd
.prcskprsnullctxt

cobjvEO*jO*k/,&EUOkjO*jO,%a%a*ak/a,lOkjOVkjkhk!kjOaaaakvlUYhOa/a*ak/a,lOkj[OYU
jSolid Stone:Users:mrflix:Projects:git:zammad:contrib:ascr
ޭ

FasdUAS 1.101.10
k
l
r
J

m

puma -p 3000
mJruby script/websocket-server.rb start
m&guard -P livereload
mgulp
	o0commandlistcommandList
l
l
O
k
!!"#
"I

.miscactvnullobj #$
$r%&
%c'(
'l)
)n*+
*1

fvtg
+4,

brow
,m
(m

ctxt
&o0
currentdir
currentDir
 m
--MACSalisrSolid StoneH+s
Finder.app0B	 CoreServiceseBsss5Solid Stone:System:Library:CoreServices:Finder.app
Finder.appSolid Stone&System/Library/CoreServices/Finder.app/./
.l/01
0l$2
2I$3
.sysodelanullnmbr
3m 145
4l56
6l%7
7O%89
8k)::;<
;I).
.miscactvnullobj <=>
=I/I?@
.coredoscnullctxt
?b/8AB
Ab/4CD
Cm/0EEFFcd
Dl03G
Gn03HI
H113

psxp
Io010
currentdir
currentDir
Bm47JJKK..@L

kfil
Ln;EMN
M1AE

tcnt
Nl;AO
O4;AP

cwin
Pm?@>QR
QlJJRST
SIJOU
.sysodelanullnmbr
UmJKTVW
VlPPWX
XYPYZ[
Yk^\\]^
]Z^_`
_?^aab
ao^_0n
bm_`
`kdccde
dIdif
.sysodelanullnmbr
fmdeeg
gOjhi
hIpjk
.prcskprsnullctxt
jmpsllmmtkn

faal
nJv{oop
pmvy
eMdsKcmd
imjmqqsevsalisSolid StoneH+sSystem Events.app5>	 CoreServicese5"sss<Solid Stone:System:Library:CoreServices:System Events.app$System Events.appSolid Stone-System/Library/CoreServices/System Events.app/^rs
rItu
.coredoscnullctxt
tlv
vnwx
w4y

cobj
yo0n
xo0commandlistcommandListuz

kfil
zn{|
{1

tcnt
|l}
}4~

cwin
~ms
I
.sysodelanullnmbr
m0n
ZmST
[ITY
.corecnte********
oTU0commandlistcommandList
9m%&@alisjSolid StoneH+sTerminal.app5B	 	Utilitiese5&hss1Solid Stone:Applications:Utilities:Terminal.appTerminal.appSolid Stone#Applications/Utilities/Terminal.app/
.aevtoappnull****0commandlistcommandList0
currentdir
currentDir
.aevtoappnull****
k060n
-EJql0commandlistcommandList
.miscactvnullobj

brow

fvtg

ctxt0
currentdir
currentDir
.sysodelanullnmbr

psxp

kfil

cwin

tcnt
.coredoscnullctxt
.corecnte********

faal
eMdsKcmd
.prcskprsnullctxt

cobjvEO*jO*k/,&EUOkjO*jO,%a%a*ak/a,lOkjOVkjkhk!kjOaaaakvlUYhOa/a*ak/a,lOkj[OYU
jSolid Stone:Users:mrflix:Projects:git:zammad:contrib:ascr
ޭ


Chg: update load_order

Chg: update load_order