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


Click here to return to the 'Regarding a previous hint involving webpage saving and applescript...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Regarding a previous hint involving webpage saving and applescript...
Authored by: kafka007 on Nov 26, '03 02:37:16PM
While this isn't directly related to the above hint, I believe it is relevant to those of us that are still searching for an easy way to archive favorite webpages (since Safari lacks a IE-type scrapbook):

I've been trying to automate pasting selected content from Safari to TexEdit (See this hint from a few days ago) 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 (again) for your time!

[ Reply to This | # ]
Regarding a previous hint involving webpage saving and applescript...
Authored by: alajuela on Nov 26, '03 03:02:34PM

Man oh man, would I love a replacement for IE's scrapbook. Neither mailing pages to myself, nor saving them as PDFs, comes close to the convenience of a scrapbook. I'm not much of a scripter either, but I'm happy to try and bang on this.



[ Reply to This | # ]
Regarding a previous hint involving webpage saving and applescript...
Authored by: qallunaaq on Nov 26, '03 03:37:05PM

I use MacJournal (freeware) for archiving selected text or entire web pages (complete with images and working urls) in Safari. MacJournal shows up in the Services menu so it's a simple matter to select/Select All and create a new entry. MacJournal may not have all the html bells and whistles but it's stable, v. useful and the price is right.



[ Reply to This | # ]
Regarding a previous hint involving webpage saving and applescript...
Authored by: kafka007 on Nov 26, '03 10:01:25PM
I agree -- MacJournal is an excellent app and I recommend it highly. One thing though: when pasting into it from Safari using the Services menu (as mentioned above), it doesn't automatically list the title of the webpage as an entry (unless I'm missing something). Perhaps the developer of MacJournal could be kindly coerced into adding this feature so it could double as a kind of IE-type scrapbook ;)

Personally, I'm looking for a single-click solution from my selection in Safari straight to a saved file in a default destination folder (such as ~users/myname/documents/web archive/) -- complete with the original webpage title as filename and including clickable links.

If only Applescript wasn't so damn difficult to pick up! Aargh!!

[ Reply to This | # ]
Regarding a previous hint involving webpage saving and applescript...
Authored by: Tim_Cox on Nov 28, '03 11:06:59AM
Good start. Thanks! Here's the basic addition you ask for. I'm sure you can polish it. Remove the click 'Save' at the end of your script and add:

property theUserFolder : "Documents:Web Snapshots:" -- You must create it before running script

tell application "Finder"
	set thePath to path to "cusr" from user domain -- returns an alias
	set theReceiver to (thePath as string) & theUserFolder & (t as string) & ".rtfd"
end tell
tell application "TextEdit"
	save document 1 in theReceiver
end tell


[ Reply to This | # ]