|
|
|
Save selected browser text via AppleScript
Very elegant script. I've been using something similar, so I cannibalized bits of this one and put them into mine. I collect loads of news clippings, so my script copies the selected text to a unique document, saved as the first line of the selection (i.e. Man Bites Dog.txt).
tell application "Finder" to set dFolder to ((startup disk) as string) & "" --write the path to your preferred folder between these quotes, using colons to separate the folder names, i.e. Users:username:Documents:MyNewsClippings: tell application "Safari" set selecTxt to (do JavaScript "(getSelection())" in document 1) set theurl to (get URL of document 1) set pgTitl to (do JavaScript "document.title" in document 1) end tell set tSubject to first paragraph of (selecTxt as string) if (tSubject contains ":") then set {oAStid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ":"} set tSubject to text items of tSubject set AppleScript's text item delimiters to "_" set tSubject to tSubject as string set AppleScript's text item delimiters to oAStid end if set dat to (current date) as text set tContent to pgTitl & return & theurl & return & dat & return & return & selecTxt set fRef to open for access file (dFolder & tSubject & ".txt") with write permission write tContent as string to fRef close access fRef tell application "Safari" to activate To use this effectively, highlight the text in Safari, such that the title of the article is the first line. The resulting .txt file will appear in your preferred folder with the filename set as the first line of selected text. I uses Fastscripts to run this one with a keystroke.
Save selected browser text via AppleScript
MrLucky
How does one do this with Firefox? Al Maloney |
SearchFrom our Sponsor...What's New:HintsNo new hintsComments last 2 days
Links last 2 weeksNo recent new linksWhat's New in the Forums?
The Editor's Corner...Here are some of my (robg) other projects...
Hints by TopicNews from Macworld
The macosxhints PollWhat version of OS X are you running as your main OS?
Other polls | 11,464 votes | 42 comments
|
|
Copyright © 2009 Mac Publishing LLC (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Powered by Geeklog Created this page in 0.03 seconds |
|