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

Capturing selection with AppleScript Thread Tools Search this Thread Display Modes
Hello everyone,

I apologize if this is a repeat question, but I've been looking at the forum, looking at the OmniFocus dictionary and searching the Internet for the answer, but have not gotten anywhere to resolve my problem. So perhaps someone here can kindly let me know whether and how one can capture a given selection (e.g., a selected task) with AppleScript. I would like to create a Script that once I have selected a project or a task, but especially a task, I can trigger a script.

If that is not possible with the current version of OmniFocus, is it possible to select a project ("focus") and then have a script retrieve information on that project alone? I'm thinking that perhaps "selected trees" is a way to get to it, but I can't get the syntax right.

Any help is much appreciated.

I figured it out, finally:
tell application "OmniFocus"
tell document 1
tell (first document window whose index is 1)
set SelectionV to selected trees of content
--Then you can parse the resulting variable (SelectionV) to get the data you want:
repeat with i from 1 to (count of SelectionV)
set ItemV to value of item i of SelectionV
end repeat
end tell
end tell
end tell

Last edited by MB_UST; 2008-06-14 at 03:56 PM..

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Capturing Tasks u352 Applying OmniFocus 1 2012-02-06 02:55 AM
Capturing stuff without a Mac asmod3us Applying OmniFocus 5 2011-05-20 06:53 AM
Applescript: obtain selection from the Project list fudster OmniFocus Extras 4 2009-07-22 05:18 PM
Export issue / Modify the selection in a Document via AppleScript / Scripting Bridge Scifer_2008 OmniGraffle General 0 2008-10-08 07:06 AM
capturing email with OF SamT OmniFocus 1 for Mac 10 2007-09-23 04:29 AM

All times are GMT -8. The time now is 07:55 PM.

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