Simple Safari Applescript script won't create.

Hi all,
First post, thanks for allowing me to join.
:?: This is a dumb question, really.

Trying to create a really simple applescript script that will tell Safari to reset and produce keyboard equilivant. Reset Safari has no keyboard equal and requires menu action plus clicking OK in the dialog box, as we all know. Having an applescript script do this with a single keyboard cmd is the desired end state.

Tried script recorder - recorder didn’t record.
Tried writing:
tell application safari
reset
end tell

All I got was an end of line syntax error.

Tried to find solution in book by Derrick Schneider, not found.
There is probably something really obvious that I’m omitting, and I will be extremely grateful for your wisdom and help.

Thanks much,
Adonsa
System Panther 10.3.7, G4-667

Welcome to macscripter.

This did it for me…

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

j

[color=DarkBlue]Hi Jobu,
Many many thanks for helping me out. Obviously I’ve gotta replace my 1993Applescript book. :?

How can I add a keyboard command, ie. CTL Z or whatever
to an applescript script?

Thanks again, Jobu, I really appreciate!
Adonsa[/color]

Adonsa: this is a shameless plug, but why don’t you give my FastScripts utility a try:

http://www.red-sweater.com/RedSweater/FSDownload.html

It lets you assign keystrokes to any script in your scripts folder, and you can also set application-specific keystrokes. For instance, I have a bunch of “Safari Specific” scripts in my ~/Library/Scripts/Applications/Safari folder set up to do things like “go to google” with ctrl-g, etc. FastScripts is especially well suited for script execution, because it takes care to avoid a lot of the disturbing context-switches and delays that other utilities suffer from.