The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   Auto-Flag by Context (http://forums.omnigroup.com/showthread.php?t=28805)

Juandp77 2013-03-21 10:11 AM

Auto-Flag by Context
 
Hello, I have setup my omnifocus workflow where I use context as a priority level, so I use High, Medium and low Priority context. What I want to know is if there is an apple-script that can automatically flag all the action sthat use the context High Priority or maybe that all items that I flag automatically get that context.

I believe that could be useful as I have setup my iOS devices to use the icon badge for flagged items so every time I have a high priority item it will be represented on my home screen.

Thanks

RobTrew 2013-03-21 12:01 PM

The simplest script might look something like this:

[CODE]tell application id "OFOC"
tell default document
set flagged of flattened tasks where name of its context contains "high" to true
end tell
end tell[/CODE]

RobTrew 2013-03-21 12:20 PM

or, going in the other direction which you mention:

[CODE]tell application id "OFOC"
tell default document
set oContext to first flattened context where name = "high"
set context of (flattened tasks where flagged = true) to oContext
end tell
end tell[/CODE]

Juandp77 2013-03-22 07:24 AM

thank you. One las question how can I keep the script running in the background

whpalmer4 2013-03-22 07:28 AM

You can't; you run it periodically, or as needed.

RobTrew 2013-03-22 08:33 AM

and perhaps one way of running it periodically would be with some kind of Hazel rule (as in [url]http://forums.omnigroup.com/showthread.php?t=27370[/url] ).

(perhaps whenever the OF cache changes, but with a few minutes lag, to avoid circularities).

Juandp77 2013-03-22 09:04 AM

I'm planing to convert the script into an aplication and then runing it every x time with lingon3 as a launchd


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

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