Jump to content

Search Omnifocus: free text search your Omnifocus data


Recommended Posts

  • Replies 57
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

What is this?   This is a workflow that allows you to run free text searches against your OmniFocus data.   Why would I need this?   Well, it's difficult to quickly search for, say, a task using

So I took @deanishe's good advice and updated the workflow to use an AppleScript call to find the OmniFocus resources directory if the app isn't installed in the default location.   Thanks for every

This workflow is awesome, thanks! I just installed and tried it out, I knew I had a task that I'd set a due date for within a few weeks. I normally live in my "today" perspective in OmniFocus. To find

Posted Images

Hi,

 

What version of OmniFocus are you using? By default, the workflow assumes you're using version 2 but, if you're using 3, you can switch by typing the Alfred keyword `use-of-3`.

 

Let me know if that solves it, otherwise please share your Alfred workflow log by following these steps:

  • Show Alfred preferences (keyword 'alf')
  • Click 'Workflows' in the tool bar
  • Choose 'Search Omnifocus' from the list of workflows on the left
  • Click on the 'Debug' to toggle debugging mode (see Alfred's help page for more info)
  • Choose 'All information' from the Log dropdown
  • Open Alfred and type the query that's not working
  • Copy the debug output and post it as a response - I'll take a look.

Cheers,
Rhyd

Link to post

Hi,

 

What version of OmniFocus are you using? By default, the workflow assumes you're using version 2 but, if you're using 3, you can switch by typing the Alfred keyword `use-of-3`.

 

Let me know if that solves it, otherwise please share your Alfred workflow log by following these steps:

  • Show Alfred preferences (keyword 'alf')
  • Click 'Workflows' in the tool bar
  • Choose 'Search Omnifocus' from the list of workflows on the left
  • Click on the 'Debug' to toggle debugging mode (see Alfred's help page for more info)
  • Choose 'All information' from the Log dropdown
  • Open Alfred and type the query that's not working
  • Copy the debug output and post it as a response - I'll take a look.

Cheers,
Rhyd

Link to post

I'm using OmniFocus 3.1.1.  If I type the "use-of-3" it seems to work.  Is there a way to change the workflow to automatically work with OF3 or simplify the text used to trigger the workflow

 (e.g., "of3").

 

Thanks for your help and quick response.  I really appreciate the help.

Link to post
  • 2 weeks later...
On 10/22/2018 at 11:48 PM, DeLaDave said:

I'm using OmniFocus 3.1.1.  If I type the "use-of-3" it seems to work.  Is there a way to change the workflow to automatically work with OF3 or simplify the text used to trigger the workflow

 (e.g., "of3").

 

Thanks for your help and quick response.  I really appreciate the help.

You should only have to do that once.

Link to post
10 hours ago, rhyd said:

Hi, not currently. The workflow assumes that all tasks in the inbox are processed into projects before completion.

 

Thanks, didn't realize that was why. I deleted the completed tasks that weren't assigned a project and now the command works just fine :) Also, big thanks for this workflow! 

Link to post
  • 2 weeks later...
  • 7 months later...

Anyone else having trouble using some of these actions after upgrade to Alfred 4?

 

I know searching folders and searching tags is not working for me (returning error: "No such column: active").

 

This could also be the result of me using beta version of OF 3, which adds the "dropped" status.

Link to post
  • 2 weeks later...
  • 4 weeks later...
  • 9 months later...

I just downloaded your workflow and quickly stepped through all the options - it looks really good, thank you for sharing your work.

 

I did get one error though ...

 

477530783_ScreenShot2020-05-10at4_05_11PM.png.293acd49c962056423cdc3d7e8fe512d.png

 

I then read about the use-of options and ran use-of-3, but the result was the same.

 

I am running Omnifocus 3.6.4 and Alfred 4.0.9 on macOS Mojave 10.14.6

Link to post

@paulf can you post your Alfred log when you use the .d search option please? It'll help me work out what's up (especially if the other options are working). Info on how to do this:

  • Show Alfred preferences (keyword 'alf')
  • Click 'Workflows' in the tool bar
  • Choose 'Search Omnifocus' from the list of workflows on the left
  • Click on the 'Debug' to toggle debugging mode (see Alfred's help page for more info)
  • Choose 'All information' from the Log dropdown
  • Open Alfred and type .d 
  • Copy the debug output and attach it/post it as a response - I'll take a look.

 

Link to post
  • 2 months later...

Hello I am new to Alfred and getting the same error notices as above for any search. He is the debug info: (Thank you for any help!)

 

[15:21:52.500] Logging Started...

[15:22:08.138] Logging Stopped.

[15:25:06.012] Logging Started...

[15:25:46.765] Search OmniFocus[Script Filter] Queuing argument 'jodie'

[15:25:47.065] Search OmniFocus[Script Filter] Script with argv '(null)' finished

[15:25:47.072] ERROR: Search OmniFocus[Script Filter] Code 1: .

15:25:46 workflow.py:2055 DEBUG    ---------- Search OmniFocus (2.0.3) ----------

15:25:46 workflow.py:1462 DEBUG    reading settings from /Users/richardfaulding/Library/Application Support/Alfred/Workflow Data/net.rhydlewis.alfred.searchomnifocus/settings.json

15:25:46 workflow.py:2339 DEBUG    update check not due

15:25:46 search.py:48 DEBUG    Started workflow

15:25:46 search.py:179 DEBUG    [u'-t', u'c', u'jodie']

15:25:46 workflow.py:1689 DEBUG    loading cached data: /Users/richardfaulding/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.rhydlewis.alfred.searchomnifocus/__workflow_update_status.cpickle

15:25:46 workflow.py:2269 DEBUG    update_data: {u'available': True, u'version': u'v2.1.1', u'download_url': u'https://github.com/rhydlewis/search-omnifocus/releases/download/v2.1.1/Search.OmniFocus.v2.1.1.alfredworkflow'}

15:25:46 search.py:57 INFO     Using OmniFocus version 3

15:25:46 search.py:193 DEBUG    Using stored icon_root:'/Applications/OmniFocus.app/Contents/Resources'

15:25:46 search.py:141 DEBUG    Searching contexts/tags

15:25:46 search.py:80 DEBUG    SELECT persistentIdentifier AS id, name AS name, allowsNextAction AS allows_next_action, active AS active, availableTaskCount AS available_task_count FROM Context WHERE active = 1 AND lower(name) LIKE lower('%jodie%') ORDER BY name ASC

15:25:46 search.py:211 DEBUG    OmniFocus db not found at /Users/richardfaulding/Library/Containers/com.omnigroup.OmniFocus3/Data/Library/Application Support/OmniFocus/OmniFocus Caches/OmniFocusDatabase; using /Users/richardfaulding/Library/Containers/com.omnigroup.OmniFocus3.MacAppStore/Data/Library/Application Support/OmniFocus/OmniFocus Caches/OmniFocusDatabase instead

15:25:46 search.py:221 DEBUG    /Users/richardfaulding/Library/Containers/com.omnigroup.OmniFocus3.MacAppStore/Data/Library/Application Support/OmniFocus/OmniFocus Caches/OmniFocusDatabase

15:25:46 workflow.py:2074 ERROR    unable to open database file

Traceback (most recent call last):

  File "/Users/richardfaulding/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.1F519CCC-3392-45BA-B5F0-5B75F526131F/workflow/workflow.py", line 2067, in run

    func(self)

  File "search.py", line 63, in main

    get_results(sql, args.type, factory)

  File "search.py", line 81, in get_results

    results = run_query(sql)

  File "search.py", line 233, in run_query

    conn = sqlite3.connect(db_path)

OperationalError: unable to open database file

15:25:46 workflow.py:2097 DEBUG    ---------- finished in 0.052s ----------

[15:25:47.077] Search OmniFocus[Script Filter] <?xml version="1.0" encoding="utf-8"?>

<items><item valid="no"><title>Error in workflow 'Search OmniFocus'</title><subtitle>unable to open database file</subtitle><icon>/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns</icon></item></items>

Link to post
  • 1 month later...

This script looks awesome, I'm excited to get it to work for me.

 

I'm also getting a "Unable to open database file" when using any commands @rhyd

Alfred 4.1

Omnifocus 3.9.1

 

Here's my error log:

[09:04:09.539] Logging Started...
[09:04:14.320] Search OmniFocus[Script Filter] Queuing argument ''
[09:04:14.480] Search OmniFocus[Script Filter] Script with argv '(null)' finished
[09:04:14.482] ERROR: Search OmniFocus[Script Filter] Code 1: .
09:04:14 workflow.py:2061 DEBUG    ---------- Search OmniFocus (2.0.6) ----------
09:04:14 workflow.py:1468 DEBUG    reading settings from /Users/rlow/Library/Application Support/Alfred/Workflow Data/net.rhydlewis.alfred.searchomnifocus/settings.json
09:04:14 workflow.py:2343 DEBUG    update check not due
09:04:14 search.py:48 DEBUG    Started workflow
09:04:14 search.py:179 DEBUG    [u'-t', u'i']
09:04:14 workflow.py:1695 DEBUG    loading cached data: /Users/rlow/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.rhydlewis.alfred.searchomnifocus/__workflow_latest_version.cpickle
09:04:14 search.py:57 INFO     Using OmniFocus version 3
09:04:14 search.py:193 DEBUG    Using stored icon_root:'/Applications/OmniFocus.app/Contents/Resources'
09:04:14 search.py:147 DEBUG    Searching inbox
09:04:14 search.py:80 DEBUG    SELECT t.persistentIdentifier AS id, t.name AS name, t.dateCompleted, t.blockedByFutureStartDate AS blocked_by_future_start_date, p.name AS project_name, t.flagged, t.dateToStart AS start_date, t.inInbox AS in_inbox, t.effectiveInInbox AS effective_in_inbox, t.effectiveDateToStart AS effective_start_date, t.childrenCountAvailable AS child_count, t.blocked AS blocked, pi.status AS status, t.effectiveFlagged, t.dateModified AS modified, t.containingProjectInfo AS parent, t.dateDue AS due_date FROM ((task tt left join projectinfo pi on tt.containingprojectinfo=pi.pk) t left join task p on t.task=p.persistentIdentifier)  WHERE (t.effectiveInInbox = 1 OR t.inInbox = 1) ORDER BY t.name ASC
09:04:14 search.py:211 DEBUG    OmniFocus db not found at /Users/rlow/Library/Containers/com.omnigroup.OmniFocus3/Data/Library/Application Support/OmniFocus/OmniFocus Caches/OmniFocusDatabase; using /Users/rlow/Library/Containers/com.omnigroup.OmniFocus3.MacAppStore/Data/Library/Application Support/OmniFocus/OmniFocus Caches/OmniFocusDatabase instead
09:04:14 search.py:221 DEBUG    /Users/rlow/Library/Containers/com.omnigroup.OmniFocus3.MacAppStore/Data/Library/Application Support/OmniFocus/OmniFocus Caches/OmniFocusDatabase
09:04:14 workflow.py:2080 ERROR    unable to open database file
Traceback (most recent call last):
  File "/Users/rlow/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.D3F61BAF-27A3-4BE8-9E69-423ED4CF81D2/workflow/workflow.py", line 2073, in run
    func(self)
  File "search.py", line 63, in main
    get_results(sql, args.type, factory)
  File "search.py", line 81, in get_results
    results = run_query(sql)
  File "search.py", line 233, in run_query
    conn = sqlite3.connect(db_path)
OperationalError: unable to open database file
09:04:14 workflow.py:2103 DEBUG    ---------- finished in 0.024s ----------
[09:04:14.484] Search OmniFocus[Script Filter] <?xml version="1.0" encoding="utf-8"?>
<items><item valid="no"><title>Error in workflow 'Search OmniFocus'</title><subtitle>unable to open database file</subtitle><icon>/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns</icon></item></items>

Link to post

Hi @rlow, thanks for getting in touch. To solve this, I'll need to know where your OF database actually is (or if it's in the expected place but the workflow doesn't have permission to access it). Can you:

 

1. Open Terminal.app and run this command:

find ~/Library/ -name "OmniFocusDatabase"  2>&1 | grep -v "not permitted"

2. Copy and paste the result here

 

Thanks,
Rhyd

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...