This script will save the selection in Safari to a Yojimbo note and
place the URL in the comment field of the note. The note name will
be the name of the web page. It is modified from a previous posting
to this list by J. Stewart. To use this, save it to your /Users/
your_name/Library/Scripts/Applications/Safari folder then invoke the
script when you have text selected in Safari.
Cheers,
--Rhet
-- cut here for script
--Get selected text in Safari and store as Yojimbo note
--stores the page URL in comments
--From J. Stewart <[EMAIL PROTECTED]> email to Yojimbo-Talk
-- http://www.listsearch.com/Yojimbo/Thread/index.lasso?463#2721
--This doesn't always work as expected:
-- --Sometimes the selected text formatting is screwy with extra
whitespace and linebreaks
-- --(doesn't happen in TextEdit service or pasting to TextEdit)
-- --Also, sometimes the title is blank even when it the document
has a title
tell application "Safari"
activate
set theURL to URL of document 1
set theName to do JavaScript "document.title" in document 1
set theTxt to do JavaScript " window.getSelection() + ''" in document 1
end tell
tell application "Yojimbo"
set itmID to (make new note item with properties {name:theName,
contents:theTxt, comments:theURL, flagged:false})
end tell
On Mar 8, 2008, at 1:10 PM, Wayne Hardy wrote:
I am likely converting from EagleFiler to Yojimbo, but I need to
confirm that I can do the following somehow.
I need to capture the source URL of a website when I copy it,
whether highlighting some text on a page or capturing a web
archive. (I need to copy quite a bit of data from the Internet,
then be able to document the source months later.)
I searched the archives and found that it might be possible through
a script. But, the poster asked for clarification, then the thread
stopped. Could anyone give me a clear answer to this, as well as an
idea how to do it if its through scripting. I have not yet done
anything with scripts.
Thanks,
whardy
--
------------------------------------------------------------------
This message is sent to you because you are subscribed to
the mailing list <yojimbo-talk@barebones.com>.
To unsubscribe, send mail to: <[EMAIL PROTECTED]>
List archives: <http://www.listsearch.com/yojimbotalk.lasso>
Have a feature request, or not sure if the software's working
correctly? Please send mail to: <[EMAIL PROTECTED]>