Last active
December 26, 2015 16:19
-
-
Save Zettt/7179578 to your computer and use it in GitHub Desktop.
Script to make a new inbox task in OmniFocus for frontmost Safari window and its open tabs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
http://veritrope.com | |
Safari URLs List to OmniFocus | |
Version 1.0 | |
April 23, 2011 | |
Project Status, Latest Updates, and Comments Collected at: | |
http://veritrope.com/code/safari-tab-list-to-omnifocus | |
========= | |
BASED ON THIS SAFARI/EVERNOTE SCRIPT: | |
http://veritrope.com/code/export-all-safari-tabs-to-evernote/ | |
WITH GREAT THANKS TO GORDON WHO SUBMITTED THE OMNIFOCUS MODIFICATION! | |
========= | |
Installation: Just double-click on the script! | |
FastScripts Installation (Optional, but recommended): | |
--Download and Install FastScripts from http://www.red-sweater.com/fastscripts/index.html | |
--Copy script or an Alias to ~/Library/Scripts/Applications/Yojimbo | |
--Set up your keyboard shortcut | |
CHANGELOG: | |
1.00 INITIAL RELEASE | |
1.10 Removed unnecessary code | |
don't output double return on last tab | |
process frontmost window instead of window 1 | |
better documentation | |
more consistent naming of variables (url_list, TabInfo) | |
Changes provided by Zettt http://macosxscreencasts.com | |
*) | |
set urlList to {} | |
set currentTab to 0 | |
-- set OmniFocus date stamp | |
set the dateStamp to ((the current date) as string) | |
set noteTitle to "URL List from Safari Tabs on " & the dateStamp | |
tell application "Safari" | |
-- processing frontmost Safari window | |
set safariWindow to first window | |
set tabCount to (count of (tabs of safariWindow)) | |
try | |
repeat with t in (tabs of safariWindow) | |
set currentTab to currentTab + 1 | |
set tabTitle to (name of t) | |
set tabURL to (URL of t) | |
if currentTab is not equal to tabCount then | |
set tabInfo to (tabTitle & return & tabURL & return & return) | |
else | |
-- don't output double return on last tab | |
set tabInfo to (tabTitle & return & tabURL) | |
end if | |
copy tabInfo to the end of urlList | |
end repeat | |
end try | |
end tell | |
-- to check the output of this script | |
--log urlList as text | |
tell front document of application "OmniFocus" | |
make new inbox task with properties {name:(noteTitle), note:urlList as rich text} | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment