Copy conents of Web page in Safari

Simple I’m sure, but I’m still learning.

All I want is for a Applescript that essentially hits Command-A (select all) and then Command-C (copy) for a particular web site from within Safari.

GUI scripting would be nice to avoid, but if necessary…


There’s no need to resort to GUI scripting for this. Safari makes this easy:

tell application “Safari”
get text of document 1
end tell

This will return the text in the frontmost window.