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


Click here to return to the 'Create Safari clippings complete with images and links' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create Safari clippings complete with images and links
Authored by: MrLucky on Jul 16, '07 09:31:48AM

Or....highlight the text and images you want and click Safari>Services>TextEdit>New Window Containing Selection.

If, like me, you do this often, go to your Keyboard/Mouse preferences and make a Keyboard shortcut for this command.

I also keep a huge clippings file of news items that relate to my work. In this case, I don't want to keep all the images - it would be far too bulky. So I created a script that will take the highlighted text, strip off the images, and save it in a pre-designated folder as a .txt file with the first line of highlighted text set as the filename. It also appends the clipping's original URL at the end of the text.

I'm an Applescript amateur so don't laugh, but here it is (note - place the path name to your clippings file in the quotes in the first line):

tell application "Finder" to set dFolder to ((startup disk) as string) & "Users:username:Documents:clippingfile:" --> this is the path to your clippings folder, so insert your preferred location

tell application "System Events"
tell process "Safari"
set frontmost to true --> bring app to the foreground
click menu item 5 of menu 1 of menu bar item 4 of menu bar 1 --> copy
end tell
end tell

tell application "Safari"
ignoring case
set theURL to URL of front document
end ignoring
set tSubject to first paragraph of (the clipboard as string)
if (tSubject contains ":") then -- Check for presence of ':" in local_String
-- Standard 'AppleScript's text item delimiters' preparation.
set {oAStid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ":"}
set tSubject to text items of tSubject -- Creates a list of items separated by ":'.
set AppleScript's text item delimiters to "_" -- Set a new delimiter character.
set tSubject to tSubject as string -- Creates a string from created list with '_' as the new delimiter.
set AppleScript's text item delimiters to oAStid -- Restore 'AppleScript's text item delimiters'.
end if
set tContent to (the clipboard) & return & return & theURL
set fRef to open for access file (dFolder & tSubject & ".txt") with write permission -- Create a new file at dFolder.
write tContent as string to fRef -- Write the text to the new file.
close access fRef -- Close the new file.
end tell

(I use FastScripts so that I can assign a keyboard shortcut to this script to make the whole process even speedier).



[ Reply to This | # ]