Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Looking for help with an applescript for this...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Looking for help with an applescript for this...
Authored by: kafka007 on Nov 20, '03 07:15:31PM
Since this is about as close as we're going to get to the scrapbook function found in IE (saving whole web pages in one file), I've been trying to automate this with an applescript.

Unfortunately, I don't know diddly about scripting and could use some help.

Here's what I have so far:

tell application "Safari"
	activate
	set t to name of window 1
end tell
set the clipboard to ""
tell application "System Events"
	tell process "Safari"
		click menu item "Select All" of menu "Edit" of menu bar 1
		click menu item "Copy" of menu "Edit" of menu bar 1
	end tell
end tell
tell application "Safari"
	activate
	set t to name of window 1
end tell

tell application "TextEdit"
	activate
	make new document at the beginning of documents
	set name of window 1 to t
end tell

tell application "System Events"
	tell process "TextEdit"
		click menu item "Paste" of menu "Edit" of menu bar 1
		click menu item "Save" of menu "File" of menu bar 1
	end tell
end tell

Now, obviously, this does not quite work as intended. It does select the contents of the page in Safari, copies and then pastes it into a new document in TextEdit.

What I'd like it to do is this: After the paste into TextEdit, automatically have the file named after the window in Safari and saved in a specific folder (for example, "~/Users/MyName/Documents/Web Snapshots/"

At this point, I give up. But I would love to use this while in Safari to archive articles without any fuss. Can anybody lend a hand with this little project?

I also thought others might be interested in using this, too -- once it's finished!

Thanks for your time.

[ Reply to This | # ]