--reset the value of the Home Page set HomePage to "http://www.google.com.au" set pListpath to "/Volumes/MacintoshHD/Users/UserName/Library/Preferences/" & "com.apple.internetconfigpriv.plist" tell application "System Events" tell property list file pListpath get value of property list item "WWWHomePage" if value of property list item "WWWHomePage" is HomePage then return else set value of property list item "WWWHomePage" to HomePage end if end tell -- find running apps set runningApps to name of every process end tell -- now loop through each application repeat with eachApp in runningApps try -- here's the try statement tell application eachApp -- tell each app in turn if eachApp contains "Safari" then quit eachApp end if end tell on error -- if the above statement fails... -- do nothing - just ignore the error and move on end try end repeat launch application "Safari" --relaunch Safari