Jump to content

Search Omnifocus: free text search your Omnifocus data


Recommended Posts

@mike007 problem here is that macOS no longer supports python and therefore this workflow without some additional steps on your part. 

 

You can either:

 

1. follow Alfred's instructions to install a version of Python 2 to allow this workflow to continue working on Monterey
2. install my alternative Javascript version of the workflow (install instructions)

 

I'd recommend #2 - let me know how you get on.

Link to comment

Thanks @rhyd

 

I am so hopeless on this! I have tired to install your version. Have a version number for both the node and nmp, so go to run npm install --global alfred-search-omnifocus Presumably in the terminal? and I just get a whole page of errors.

 

Never mind! I will call it a day!!

Link to comment
  • 3 weeks later...

Thanks for this update!

 

I set the OmniFocus DB location per the installation instructions but the workflow is giving me this error (even though the directory does exist). Any ideas?

of-db-search-error@2x.thumb.png.982948e56b16df1a4eb0605fd08a97f7.png

 

 

EDIT → WORKAROUND FOUND

After you run "find-of-db" you will need to remove the line breaks that are getting inserted where they don't belong before running "set-of-db"

 

Issue is here: https://github.com/rhydlewis/alfred-search-omnifocus/issues/9

Edited by jochi
Found a workaround, wanted to include it inline
Link to comment

Thank you for your incredible workflow! It seems that it doesn't work now for my OmniFocus(Version 3.12.2), when I try to search something in my OmniFocus using this workflow I just get nothing. I wonder whether it's the problem of my OmniFocus/Alfred/Mac or it's because of the workflow. Thank you!

Link to comment
  • 3 weeks later...
  • 5 months later...

@rhydI just posted about using the python version of the workflow, but I was in the wrong place, and found the node one.

 

Now I admit, I don't know much about terminal, so perhaps this is over my head, and I don't expect you to teach me, but I thought I'd ask in case there was an easy fix.

 

I followed all of the directions to install and test node here: https://treehouse.github.io/installation-guides/mac/node-mac.html

 

According to the steps provided it was successful.

 

When I then went to use the npm install --global alfred-search-omnifocus command, I get these errors:

 

(**** = me and my system's name)

 

Am I missing something? Is there anything to fix?

 

I appreciate your time and consideration.


npm@8.15.0 /usr/local/lib/node_modules/npm
**** ~ % npm <command> --key=value
zsh: no such file or directory: command
**** ~ % npm install --global alfred-search-omnifocus
npm WARN deprecated xmldom@0.1.31: Deprecated due to CVE-2021-21366 resolved in 0.5.0
npm ERR! code 1
npm ERR! path /opt/homebrew/Cellar/node/19.4.0_1/lib/node_modules/alfred-search-omnifocus/node_modules/better-sqlite3
npm ERR! command failed
npm ERR! command sh /var/folders/sc/26yzps7x15dfdg5n56n8kq2r0000gn/T/install-d0aa4b18.sh
npm ERR! > better-sqlite3@7.6.2 build-release
npm ERR! > node-gyp rebuild --release
npm ERR! 
npm ERR!   TOUCH ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm ERR!   ACTION deps_sqlite3_gyp_locate_sqlite3_target_copy_builtin_sqlite3 ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm ERR!   TOUCH Release/obj.target/deps/locate_sqlite3.stamp
npm ERR!   CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
npm ERR!   LIBTOOL-STATIC Release/sqlite3.a
npm ERR!   CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o
npm ERR! rm ba23eeee118cd63e16015df367567cb043fed872.intermediate
npm ERR! prebuild-install warn install No prebuilt binaries found (target=19.4.0 runtime=node arch=arm64 libc= platform=darwin)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.3.0
npm ERR! gyp info using node@19.4.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.10.9 found at "/opt/homebrew/opt/python@3.10/bin/python3.10"
npm ERR! gyp info spawn /opt/homebrew/opt/python@3.10/bin/python3.10
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/opt/homebrew/Cellar/node/19.4.0_1/lib/node_modules/alfred-search-omnifocus/node_modules/better-sqlite3/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   ‘/Users/****/Library/Caches/node-gyp/19.4.0/include/node/common.gypi’,
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   ‘-Dnode_root_dir=/Users/****/Library/Caches/node-gyp/19.4.0’,
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/****/Library/Caches/node-gyp/19.4.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/opt/homebrew/Cellar/node/19.4.0_1/lib/node_modules/alfred-search-omnifocus/node_modules/better-sqlite3',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/better_sqlite3.cpp:4:
npm ERR! In file included from ./src/better_sqlite3.lzz:11:
npm ERR! In file included from /Users/****/Library/Caches/node-gyp/19.4.0/include/node/node.h:73:
npm ERR! In file included from /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8.h:24:
npm ERR! In file included from /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-array-buffer.h:12:
npm ERR! In file included from /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-local-handle.h:12:
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:477:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! SHARED_EXTERNAL_POINTER_TAGS(CHECK_SHARED_EXTERNAL_POINTER_TAGS)
npm ERR!                              ^
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:477:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:477:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:477:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:477:30: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! PER_ISOLATE_EXTERNAL_POINTER_TAGS(CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS)
npm ERR!                                   ^
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:478:35: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:659:61: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR!     static_assert(kJSObjectType + 1 == kFirstJSApiObjectType);
npm ERR!                                                             ^
npm ERR!                                                             , ""
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:660:55: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR!     static_assert(kJSObjectType < kLastJSApiObjectType);
npm ERR!                                                       ^
npm ERR!                                                       , ""
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-internal.h:661:63: warning: 'static_assert' with no message is a C++17 extension [-Wc++17-extensions]
npm ERR!     static_assert(kFirstJSApiObjectType < kLastJSApiObjectType);
npm ERR!                                                               ^
npm ERR!                                                               , ""
npm ERR! In file included from ../src/better_sqlite3.cpp:4:
npm ERR! In file included from ./src/better_sqlite3.lzz:11:
npm ERR! In file included from /Users/****/Library/Caches/node-gyp/19.4.0/include/node/node.h:73:
npm ERR! In file included from /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8.h:24:
npm ERR! In file included from /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-array-buffer.h:13:
npm ERR! In file included from /Users/j****/Library/Caches/node-gyp/19.4.0/include/node/v8-object.h:9:
npm ERR! /Users/****Library/Caches/node-gyp/19.4.0/include/node/v8-maybe.h:106:45: error: no template named 'is_lvalue_reference_v' in namespace 'std'; did you mean 'is_lvalue_reference'?
npm ERR!   template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
npm ERR!                                        ~~~~~^~~~~~~~~~~~~~~~~~~~~
npm ERR!                                             is_lvalue_reference
npm ERR! /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:910:29: note: 'is_lvalue_reference' declared here
npm ERR! struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
npm ERR!                             ^
npm ERR! In file included from ../src/better_sqlite3.cpp:4:
npm ERR! In file included from ./src/better_sqlite3.lzz:11:
npm ERR! In file included from /Users/****/Library/Caches/node-gyp/19.4.0/include/node/node.h:73:
npm ERR! In file included from /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8.h:24:
npm ERR! In file included from /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-array-buffer.h:13:
npm ERR! In file included from /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-object.h:9:
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-maybe.h:106:69: error: expected '(' for function-style cast or type construction
npm ERR!   template <class U, std::enable_if_t<!std::is_lvalue_reference_v<U>>*>
npm ERR!                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-maybe.h:123:43: error: no template named 'is_lvalue_reference_v' in namespace 'std'; did you mean 'is_lvalue_reference'?
npm ERR! template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
npm ERR!                                      ~~~~~^~~~~~~~~~~~~~~~~~~~~
npm ERR!                                           is_lvalue_reference
npm ERR! /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:910:29: note: 'is_lvalue_reference' declared here
npm ERR! struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { };
npm ERR!                             ^
npm ERR! In file included from ../src/better_sqlite3.cpp:4:
npm ERR! In file included from ./src/better_sqlite3.lzz:11:
npm ERR! In file included from /Users/****/Library/Caches/node-gyp/19.4.0/include/node/node.h:73:
npm ERR! In file included from /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8.h:24:
npm ERR! In file included from /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-array-buffer.h:13:
npm ERR! In file included from /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-object.h:9:
npm ERR! /Users/****/Library/Caches/node-gyp/19.4.0/include/node/v8-maybe.h:123:67: error: expected '(' for function-style cast or type construction
npm ERR! template <class T, std::enable_if_t<!std::is_lvalue_reference_v<T>>* = nullptr>
npm ERR!                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
npm ERR! ./src/util/macros.lzz:157:21: error: no member named 'AccessorSignature' in namespace 'v8'
npm ERR!                 v8::AccessorSignature::New(isolate, recv)
npm ERR!                 ~~~~^
npm ERR! ./src/objects/database.lzz:180:21: warning: variable 'status' set but not used [-Wunused-but-set-variable]
npm ERR!                 int status = sqlite3_db_config(db_handle, SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, 1, NULL);
npm ERR!                     ^
npm ERR! ./src/util/binder.lzz:37:51: error: no member named 'CreationContext' in 'v8::Object'
npm ERR!                 v8::Local<v8::Context> ctx = obj->CreationContext();
npm ERR!                                              ~~~~~^
npm ERR! 21 warnings and 6 errors generated.
npm ERR! make: *** [Release/obj.target/better_sqlite3/src/better_sqlite3.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Darwin 22.2.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node/19.4.0_1/bin/node" "/opt/homebrew/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
npm ERR! gyp ERR! cwd /opt/homebrew/Cellar/node/19.4.0_1/lib/node_modules/alfred-search-omnifocus/node_modules/better-sqlite3
npm ERR! gyp ERR! node -v v19.4.0
npm ERR! gyp ERR! node-gyp -v v9.3.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/****/.npm/_logs/2023-01-16T15_02_37_959Z-debug-0.log
****@**** ~ % 


 

Link to comment

Hi @jstncwlcx - thanks for raising this. I think I need to look at the latest version of better-sqlite3 and how that works with the latest version of node. Let me do this first and then - 🤞 - I can release an updated version of the workflow to solve this wretched issue...

 

Cheers,
Rhyd

Link to comment

I've updated the workflow to v1.0.12 so that it uses the latest versions of the packages it relies on to function correctly. Horror show complication errors seen before are now - as far as I can see - no longer happening.

 

I've had issues with different versions of node and different shells on my Mac but I think if you switch to a bash shell before installing, the problems seen before won't happen:

 

> bash
bash-3.2$ node -v
v18.12.1
bash-3.2$ npm install -g alfred-search-omnifocus
...

 

Link to comment

Thanks for the reply.

 

Like I said, I don't know much about terminal or code, so this is above my head. I really only know how to copy and paste stuff.

 

I copied and pasted the lines you quoted into terminal, and literally nothing happened.

 

If you feel like it, can you walk me through what it is I am supposed to do with those lines you posted?

 

I don't expect you to teach me, so please don't think I'm expecting anything. I just thought I'd ask in case it was simple and easy to explain.

Link to comment
On 1/22/2023 at 5:21 PM, jstncwlcx said:

Thanks for the reply.

 

Like I said, I don't know much about terminal or code, so this is above my head. I really only know how to copy and paste stuff.

 

I copied and pasted the lines you quoted into terminal, and literally nothing happened.

 

If you feel like it, can you walk me through what it is I am supposed to do with those lines you posted?

 

I don't expect you to teach me, so please don't think I'm expecting anything. I just thought I'd ask in case it was simple and easy to explain.

 

Hi - no problem, this updated workflow has been more of a pain than the old version. It hasn't been a great user experience for everyone - apologies.

 

Here's step by step instructions:

  1. Open terminal.app
  2. Type in `bash` and then press RETURN
  3. Type in `npm install -g alfred-search-omnifocus` and press RETURN
  4. You should then see a progress bar as the `npm` command downloads the required files and installs the workflow.

If that doesn't work, let me know and I'll see if I can do something else to help.

 

Screenshots to accompany each step above...

 

workflow-1.thumb.png.dae7b286a69c4938055c46b3c181f390.png

workflow-2.thumb.png.a5682ae80fa1d62add0fbe60641ab195.png

workflow-3.thumb.png.9c0a9675b27a80e366f25d21280a1278.png

 

 

Edited by rhyd
Link to comment

I'm still not able to get it working.

 

It is probably user error on my end. But here is what I get...

 

Theimage.png.b21dfdc355436450b83d9a0c540e02c5.png

 

Then when I try to enter the .s command in Alfred I get this:

 

image.png.cc1cf09b5ec13500593e367645bc4ec8.png

 

 

Then, then I enter 'get-of-db' into Alfred, and hit enter, I just get a big Pop-up that says:]

 

image.thumb.png.ae4f3a0347fe016e20ad20564484a333.png

Link to comment
31 minutes ago, jstncwlcx said:

I'm still not able to get it working.

 

It is probably user error on my end. But here is what I get...

 

Theimage.png.b21dfdc355436450b83d9a0c540e02c5.png

 

Then when I try to enter the .s command in Alfred I get this:

 

image.png.cc1cf09b5ec13500593e367645bc4ec8.png

 

 

Then, then I enter 'get-of-db' into Alfred, and hit enter, I just get a big Pop-up that says:]

 

image.thumb.png.ae4f3a0347fe016e20ad20564484a333.png

 

We're getting there...  Next is:

1. Run Alfred command `find-of-db` to copy the path of the Omnifocus DB to your clipboard

2. Run Alfred command `set-of-db` and then paste (⌘-V) the database path as an argument and hit return then retry.

Link to comment
  • 2 months later...
On 1/27/2023 at 5:22 PM, rhyd said:

 

We're getting there...  Next is:

1. Run Alfred command `find-of-db` to copy the path of the Omnifocus DB to your clipboard

2. Run Alfred command `set-of-db` and then paste (⌘-V) the database path as an argument and hit return then retry.

 

Hi Rhyd, 

 

I've been following your installation steps but fail at finding the Omnifocus database path with *find-of-db*.

 

So *npm install -g alfred-search-omnifocus*, and moving from zsh to bash, looks like things were going well; database path finding, not so well. Do you have any idea what I'm messing up, here?

 

I don't know if this is useful, but here's what my CLI says ↓.

 

bash-3.2$ node -v
v19.9.0
bash-3.2$ find-of-db
bash: find-of-db: command not found
bash-3.2$

 

TIA, Jasper

Link to comment
  • 5 weeks later...
  • 4 weeks later...
On 5/23/2023 at 4:47 PM, joonbugs said:

Hi @rhyd - would you happen to know how to resolve a ARM64 / x86 error? I'm seeing this after setting the DB address. (This is running on an M1-based Mac - and I haven't had a chance to test this on an Intel Mac.) Thanks!

 

 

Screenshot 2023-05-23 at 11.42.19 AM.png

 

Not seen that error message before. Bit of an odd one... are you running the python version of the workflow or the javascript version?

Link to comment
  • 8 months later...

Hey and good day, 2 points

1.
I have npm installed

bash-3.2$ npm -v

10.2.4

but then it can't be found:

bash-3.2$ npm install --global alfred-search-omnifocus

bash: npm: command not found

v

Earlier at the end of the homebrew installation, I could do the first recommended command

==> Next steps:

- Run these two commands in your terminal to add Homebrew to your PATH:

    (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/okn/.zprofile

    eval "$(/opt/homebrew/bin/brew shellenv)"

v

this one ok: 

echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"'

v

but did not know what to do/ how to write/ with this command:

 

>> /Users/okn/.zprofile

    eval "$(/opt/homebrew/bin/brew shellenv)"

v

No .zprofile, they are 2 steps?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

2.
macos Ventura 13.4 
Search OmniFocus from Alfred - V2.1.3

Unsuccessful to open "Open in Terminal"

 

/okn
- - Still struggling --

Link to comment

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...