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

OmniFocus bought thru AppStore: Cache-querying scripts fail Thread Tools Search this Thread Display Modes
Various scripts on this board query the cache, and typically start with a property like:

property pstrDBPath : "~/Library/Caches/com.omnigroup.OmniFocus/OmniFocusDatabase2"
AppStore-purchased copies of OmniFocus can not run these scripts without modification.

A possible modification might be something like the following (though this is not bullet-proof):

set pstrDBPath to GetCachePath()

on GetCachePath()
	set strDefaultFolder to "~/Library/Caches/com.omnigroup.OmniFocus"
	set strAppStoreFolder to "~/Library/Caches/com.omnigroup.OmniFocus.MacAppStore"
	set strDBName to "OmniFocusDatabase2"
	set strCacheFolder to strDefaultFolder
	if (do shell script ("test -d " & strCacheFolder & "; echo $?")) ≠ "0" then
		set strCacheFolder to strAppStoreFolder
		if (do shell script ("test -d " & strCacheFolder & "; echo $?")) ≠ "0" then return ""
	end if
	return strCacheFolder & "/" & strDBName
end GetCachePath

Last edited by RobTrew; 2011-06-30 at 03:52 AM..
Or, I suppose, you could try using "System Events" to read the Bundle identifier key in the info.plist file inside the package.

(Looking first in /Applications/ and then perhaps falling back to ~/Applications/ if it wasn't found ...)

(But this kind of thing is, of course, hard to test because it is in the nature of the bifurcated bundle identifier problem that any given user only has one version installed, and can't test code for the other ... )

(I have asked the Ninjas whether there is a better solution to automatically detecting whether a user's data is in a com.omnigroup.OmniFocus cache or a com.omnigroup.OmniFocus.MacAppStore cache ...)



Last edited by RobTrew; 2011-07-04 at 05:25 AM.. Reason: Update: See FAQ

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Network externalities: Appstore-bought OF is worth less RobTrew OmniFocus 1 for Mac 1 2011-06-27 10:18 PM
saving to omnifocus cache... 4 ever! elektroglide OmniFocus 1 for Mac 1 2010-01-22 04:13 PM
saving to omnifocus cache connie OmniFocus 1 for Mac 3 2009-11-15 03:02 PM
OmniFocus: Querying tasks in Applescript gives odd results RobTrew AppleScripting Omni Apps 0 2008-03-01 01:03 AM
Some OmniFocus Scripts curt.clifton OmniFocus 1 for Mac 22 2007-07-23 03:04 AM

All times are GMT -8. The time now is 02:35 PM.

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