The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   Applying OmniFocus (http://forums.omnigroup.com/forumdisplay.php?f=51)
-   -   Copy multiple tasks all at once, paste one-by-one (http://forums.omnigroup.com/showthread.php?t=31362)

eurobubba 2014-03-09 10:48 AM

Copy multiple tasks all at once, paste one-by-one
 
I wanted to keep my longer-term planning (roughly from the one-year down to the one-week timeframe) in OmniFocus but try a couple of other, much simpler apps to display a to-do list for the day. The problem was that there was no easy way to import tasks into most of those other apps without copying or retyping them one-by-one. So I wrote a little AppleScript that lets me copy them from OF all at once, then run the script to choose which line I want to paste into the other app. I run it from Butler, but there are a lot of other hotkey utilities that can do the job just as well. I thought some of you here might also find it useful:

--
[CODE]tell application "System Events"
set frontApp to (file of first process whose frontmost is true) as text

try
set clipRecord to (the clipboard as record)
set fullClipText to (the clipboard as text)
activate
set myChoice to (choose from list (paragraphs of fullClipText))
on error
set myChoice to false
end try
end tell

tell application frontApp
activate
if myChoice is not false then
set the clipboard to (myChoice as text)
tell application "System Events" to keystroke "v" using {command down}
delay 0.1
set the clipboard to clipRecord
end if
end tell
[/CODE]--

It's not just for OmniFocus by any means — you can use it any time you want to copy multiple lines/paragraphs of text at once and paste them one-by-one, for example when entering contact data into a web form. Thanks to Chris Stone and Yvan Koenig over at [email]applescript-users@lists.apple.com[/email] for some optimizations.


All times are GMT -8. The time now is 01:04 AM.

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