The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   Task with selected text from Safari (http://forums.omnigroup.com/showthread.php?t=16714)

jgrafix 2010-07-09 12:10 PM

Task with selected text from Safari
 
I know that OF has a clipping service that does a really nice job using the OS X summarize function to put a summary of the selected text in the title of the task, which is a reasonable approach. So why this script?

There are times when I prefer the title of the window to be the title of the task. With the use of [URL="http://www.red-sweater.com/fastscripts/"]Fast Scripts from Red Sweater Software[/URL], I have my choice between the OF clipping key combo and the key combo for this script to create a task from a Safari page. The best of both worlds!

So here is the [I]very[/I] brief script that creates a task where:
Task Title = Window Title
Task Note = URL and Selected Text

[CODE]tell application "Safari"
set u to URL of front document
set n to name of front window
set t to (do JavaScript "(getSelection())" in document 1)
set theNote to u & return & return & t
end tell

tell application "OmniFocus"
tell default document
make new inbox task with properties {name:n, note:theNote}
end tell
end tell[/CODE]

whpalmer4 2010-07-09 12:40 PM

Thanks for posting this! I think you may have provided the solution to one of my wishes. I often wish that I had another [URL="http://catb.org/jargon/html/D/double-bucky.html"]bucky bit[/URL] that I could hold down when using the clipping shortcut so I could control whether my clipping goes straight to the Inbox, or stops in the Quick Entry box. No matter which way I set the option, inevitably the next bunch of clippings turn out to be ones where the other choice would have been better! It looks like perhaps the solution for me would be to have the clipping service go to the Quick Entry box, and cobble up a similar script to yours that puts the clipping straight in, fired off from a suitable keyboard shortcut via Fast Scripts.

Another thread to be clipped to my "Useful Applescript posts from the Omni forums" project :)


All times are GMT -8. The time now is 09:25 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.