Here’s the long and the short of things… I’ve been developing an AppleScript Studio app for about 6 months and the latest iteration is to solve a long-standing and annoying issue with Safari – auto-loading pages. My work-around renames the existing com.apple.Safari.plist file and then copies a working version in its place that has Safari open w/ blank windows. The end of the script is then to restore the user’s prefs file and delete mine, however, this isn’t working, either generating a -43 or -1728 error.
Here’s the current version fo the offending code:
on replace_safari_prefs() -- this method works perfectly
set safari_pref to "com.apple.Safari.plist"
tell application "Finder"
set name of file safari_pref in folder user_prefs to "com.apple.Safari.plist_OLD"
copy file "BadgerTest:resources:com.apple.Safari.plist" to folder user_prefs
end tell
end replace_safari_prefs
on restore_safari_prefs() -- restores users pref file and not working
set safari_pref to "com.apple.Safari.plist"
tell application "Finder"
make new Finder window to user_prefs
display dialog "Hit ok to delete"
select file safari_pref
delete file safari_pref
set name of file "com.apple.Safari.plist_OLD" in folder user_prefs to safari_pref
end tell
end restore_safari_prefs
I’ve about given-up on trying to find a working delete command, so hopefully all y’all can help me out…
Model: PBG4 15" 1.67/2GB/120GB
AppleScript: 2.1.1 – or whatever’s current
Browser: Safari
Operating System: Mac OS X (10.4)