I am trying to set a new Home Page in Safari, using this code:
set HomePage to "http://www.google.at"
tell application "System Events"
(if name of every process) contains "Safari" then tell application "Safari" to quit
do shell script "defaults write com.apple.internetconfigpriv WWWHomePage" & space & HomePage
tell application "Safari" to launch
end tell
The Settings will be set in the .plist file, but when I relaunch the Safari nothing has changed - the old
settings are still there…
thanks that works! For those who want to set it programmatically:
set HomePage to "http://www.google.at"
tell application "System Events"
(if name of every process) contains "Safari" then tell application "Safari" to quit
do shell script "defaults write com.apple.Safari HomePage" & space & HomePage
tell application "Safari" to launch
end tell
set HomePage to "http://www.google.at"
tell application "System Events" to set safariIsRunning to application "Safari" is running
if safariIsRunning then quit application "Safari"
do shell script "defaults write com.apple.Safari HomePage" & space & HomePage
if safariIsRunning then launch application "Safari"