Applescript vs. System Tiger (Safari 2.0 (412))

Hi,
Just did clean install of System Tiger. Safari Applescripts brought over no longer work at all. Tried re-compiling a script that runs fine under System Panther, no good. Tried running this one from within the script editor,
tell application “Safari” to activate

tell application “System Events”
tell application process “Safari”
click menu item “Reset Safari.” of menu “Safari” of menu bar 1
try
click button “Reset” of window 1
end try
end tell
end tell

And the script editor returned this error:
System Events got an error: NSReceiverEvaluationScriptError: 4

Anybody know how to convince System Tiger’s Safari to allow Applescript scripts to run?

Thanks very much,
Adonsa

Model: G-4 667. Transitioning to System Tiger
AppleScript: 1.1 (System Tiger’s ver)
Browser: Safari 412
Operating System: Mac OS X (10.4)

Safari is not the problem. In Tiger, GUI scripting is not enabled by default. Launch the AppleScript Utility (in /Applications/AppleScript) and check Enable GUI Scripting.

Tiger has AppleScript 1.10, not 1.1.

Hi Guardian34, Thanks much, it worked. Why did Apple set it up that way. Seems like it would have been better if an error was returned if a script could not run. I did glance at the GUI scripting option, but (erroneously) thought it pertained to Universal Access only, so I ignored the option to check that checkbox.

The zero was to the right of the decimal, so I [naturally] dropped it. Guess I screwed up.

Thanks again, guardian34, for your advice.
Adonsa

Model: G4, 667
AppleScript: One Decimal One Zero
Browser: Safari 412
Operating System: Mac OS X (10.4)

Um, there was. :confused:

It’s not a big deal, I just didn’t want anyone getting confused.

Hi Guardian34,

What I meant was if Applescript Utility
Enable GUI Scription is not checked,
then any attempt to run any applescript script should (perhaps) result in an error return rather than nothing at all. Or maybe an error with a user option to disable further warnings.

Since System Panther didn’t require interaction with a dialog box requiring “Enable GUI Scripting” I (incorrectly) assumes that Applescript would always work.

Any idea why Apple added this “feature?”

Thanks,
Adonsa

Security reasons?