The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Applescript to capture list of actions to clipboard Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
I wrote this to be able to make a list of action items that I can then paste into an email, a document, etc... The way I use this is to use OF to take meeting action items then I can select them all in OF, run this script, and the information is transferred to the clipboard. I can then paste them into an email, into a text file, into a word processor etc....

Use it if it's useful. No claims made on accuracy, effectiveness or the safety of your data. It's just written so no claim on being bug free:


tell front document of application "OmniFocus"
-- get the window the user is using
set |w| to first document window whose index is 1
-- find out where we are and if there's anything we can do

set theItems to selected trees of content of |w|

-- Detect common failure modes and explain

if ((count of theItems) is 0) then
display alert ¬
"Select an action to " & toolName message "You have not selected an action"
return
end if

(*) if ((count of theItems) is greater than 1) then
display alert ¬
"Select just one action to " & toolName message "You have selected more than one item, please select just one"
return
end if *)

set _body to "" -- null out text
repeat with cnt from 1 to (count of theItems)

set selectedItem to value of item cnt of theItems

if ((class of selectedItem) is inbox task) then
display alert ¬
"Sorry, action not supported" message "Actions in inbox do not reveal their projects in version " & toolVersion & " of " & toolName
return
end if


if ((class of selectedItem) is not task) then
display alert ¬
"Select an action to " & toolName message "You have selected something that isn't an action"
return
end if

try
set _dueDate to (get due date of selectedItem as date)
on error
set _dueDate to "None"

(* set _dueDate to text returned of (display dialog "Please enter data and time xx/xx/xxxx xx:xx AM/PM." default answer (current date) as string)
set _dueDate to _dueDate as date *)
end try


try
set _note to (get note of selectedItem)
on error
set _note to ""
end try


try
set _project to the name of (get containing project of selectedItem)
on error
set _project to "None"
end try

try
set _context to the name of (get context of selectedItem)
on error
set _contect to "None"
end try


try
set _subject to the name of selectedItem
on error
set _subect to "No Subject"
end try

set _body to _body & "Action Item: " & _subject & space & return
set _body to _body & "Due by: " & _dueDate & return
set _body to _body & "Project: " & _project & return
set _body to _body & "Who: " & _context & return & return



end repeat
end tell

set the clipboard to _body
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pausing some actions under a single actions list pauses the whole single actions list zdlo OmniFocus 1 for Mac 6 2012-08-27 09:08 PM
Applescript to Save Clipboard to Clippings? jamespro OmniOutliner 3 for Mac 0 2011-03-23 11:11 AM
Applescript to Paste from Clipboard richgoidel OmniFocus Extras 2 2010-12-13 03:00 PM
Copy Actions and/or Projects to Clipboard carlsson OmniFocus 1 for Mac 3 2010-05-31 12:27 AM
Using iSight/Mic to capture actions cez1 OmniFocus 1 for Mac 1 2009-04-30 02:59 PM


All times are GMT -8. The time now is 09:06 PM.


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