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 1 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
On desktop banner of current action Thread Tools Search this Thread Display Modes
Quote:
Originally Posted by IdeaSandbox View Post
Is there a way to change the script to do two things

(1) show me everything in my "Due" perspective?
(2) have it run w/o OmniFocus having to be open?

- Paul
Actually, you might be better off tweaking one of the scripts from this post.

I use the ListFlagged script myself and it works perfectly. There's a script there for tasks starting today. It could probably be tweaked to show tasks due today, and possibly even for tasks due this week. I know for a fact that you can get it to list the due dates by each item because the ListFlagged script does just that.

Technically OmniFocus has to be open for the script to refresh. I leave the app open but hidden (I use Spirited Away), that way the script can refresh without the OF window getting in my way. Since I use Anxiety as my HUD for OF, I rarely even look at the OF window when I'm in "doing" mode; avoids me spending time "fiddling".

Edit: Upon further inspection I suspect the cause for the issue with Curt's script was the aforementioned Spirited Away. Inactivating it and then reactivating it seemed to do the trick.

Last edited by Harry; 2009-12-13 at 07:33 AM.. Reason: Found out the cause of the problem. I think...
 
This is a great script and use of GeekTool. Thanks everyone!
 
I don't know anything about scripting. Just found GeekTool by accident and winging it by the seat of my pants. This script is awesome. Thank you Cliff and Fathom!!

A total newbie at this was actually able to use it.:-)
 
For a simple GeekTool list of selected actions, my preference is to skip truncation and use an ordinary bullet ( )

The following seems to suffice:

Code:
property pPrefix : " "
property plngPrefix : length of pPrefix

on run
	tell application id "com.apple.systemevents"
		if (count of (processes where creator type is "OFOC")) < 1 then return
	end tell
	
	tell application id "com.omnigroup.OmniFocus"
		tell front document window of front document
			set my text item delimiters to return & pPrefix
			set str to pPrefix & name of (selected trees of content) as string
			if length of str = plngPrefix then 
				set str to pPrefix & name of (selected trees of sidebar) as string
			set my text item delimiters to space
		end tell
	end tell
	return str
end run

Last edited by RobTrew; 2010-12-13 at 02:06 AM.. Reason: Updated: 1. Does not launch OF if closed 2. If nothing selected in contents panel, shows sidebar seln
 
Quote:
Originally Posted by IdeaSandbox View Post
Is there a way to ... do two things

(1) show me everything in my "Due" perspective?
(2) have it run w/o OmniFocus having to be open?
The following script should work even if OF is not running.

This draft lists all uncompleted tasks with a due date before the current system time. (A comment shows how to adjust this to to list tasks with a due date < now + N * days).

It seems to be working fine with GeekTool on my system.

Code:
property pstrDBPath : "~/Library/Caches/com.omnigroup.OmniFocus/OmniFocusDatabase2"
property pEOR : "<eor>"
property pFldDelim : "<fldelim>"
property pdteBase : missing value
property plstResults : {}

on run
	set strNow to AS2SQLDate(current date)
	-- OR A VARIANT OF:  set strNow to AS2SQLDate(current date + (2 * days))
	set strSQL to "select name, " & quoted form of pEOR & 
		"  from task where dateCompleted is null and effectiveDateDue < " & strNow & " order by effectiveDateDue"
	RunSQL(strSQL)
	
	set text item delimiters to return & " "
	set strList to " " & plstResults as string
	set text item delimiters to space
	set plstResults to {}
	strList
end run

on RunSQL(strSQL)
	set strCmd to "sqlite3 -separator '" & pFldDelim & "' " & pstrDBPath & space & quoted form of strSQL
	set text item delimiters to pFldDelim & pEOR & return -- strip out the end of line \r as well as the record delimiter
	set plstResults to text items 1 thru -2 of ((do shell script strCmd) & return)
end RunSQL

on AS2SQLDate(varDate)
	if pdteBase is missing value then
		set pdteBase to current date
		tell pdteBase
			set {its year, its month, its day, its time} to {2001, 1, 1, 0}
		end tell
	end if
	(varDate - pdteBase) as string
end AS2SQLDate

Last edited by RobTrew; 2010-12-12 at 04:10 PM.. Reason: Added clause to sort by due date
 
Alternatively, for a GeekTool list of Next Actions (displaying even when OmniFocus is not running):

Code:
property pstrDBPath : "~/Library/Caches/com.omnigroup.OmniFocus/OmniFocusDatabase2"
property pEOR : "<eor>"
property pFldDelim : "<fldelim>"

property plstResults : {}

on run
	set strSQL to "select name, " & quoted form of pEOR & 
		"  from projectinfo p join task t on p.nexttask=t.persistentidentifier order by dateDue"
	
	RunSQL(strSQL)
	
	set text item delimiters to return & " "
	set strList to " " & plstResults as string
	set text item delimiters to space
	set plstResults to {}
	strList
end run

on RunSQL(strSQL)
	set strCmd to "sqlite3 -separator '" & pFldDelim & "' " & pstrDBPath & space & quoted form of strSQL
	set text item delimiters to pFldDelim & pEOR & return -- strip out the end of line \r as well as the record delimiter
	set plstResults to text items 1 thru -2 of ((do shell script strCmd) & return)
end RunSQL
 
FWIW the Sqlite scripts above (which do not require OmniFocus to be running), are fairly fast and inexpensive operations, and I am enjoying the panoptic clarity of running several GeekTool shell panels (refreshed at c. 10-30s intervals) on my desktop:



Tip 1: The current selection list probably needs a fairly frequent refresh setting, like 10s. If, however, you would like to put the others on much less frequent refresh cycles, but still have the option of an instant refresh on demand, you can use something like FastScripts or Keyboard Maestro to assign a keystroke to the following script:

Code:
tell application id "org.tynsoe.geektool3"
	refresh all
end tell
Tip 2 You can toggle the GeekTool display on and off by attaching a script like this to a keystroke:

Code:
property pGroupName : "Default Group"

tell application id "org.tynsoe.geektool3"
	tell (first group where name = pGroupName)
		set visible to not visible
	end tell
end tell
(I have posted a generic script for display custom OF actions lists in Geektool in another thread).

--

Last edited by RobTrew; 2010-12-20 at 10:18 AM.. Reason: Updated scripts in zip file
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script: custom OmniFocus action lists on the desktop, using Geektool RobTrew OmniFocus Extras 79 2014-01-09 10:48 AM
Feature request: current action on-top sticky Craig OmniFocus 1 for Mac 7 2012-11-08 06:04 AM
New OmniFocus Banner spye OmniFocus for iPad 1 2010-07-30 05:50 AM
make OF action out of current emacs buffer jklymak OmniFocus Extras 3 2009-08-16 01:11 PM
Wanted: Growl-style bubble for current action matt_good OmniFocus Extras 18 2009-06-21 10:22 AM


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


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