Jump to content

Notion.so Instant Search Workflow


Recommended Posts

On 9/18/2022 at 5:33 PM, al1881 said:

Great workflow - thank you @wrjlewis


Works like a charm for me when opening Notion pages on the web. However, when I try to use the desktop app the same page is opened each time (although the search works perfectly). Anything I am missing?  Many thanks.

Welcome. 

 

Just to check, you've set the useDesktopClient variable to True, and it's only opening up one specific page each time? 

 

I've just tested on my desktop app and it's working as expected. It might be worth force quitting the notion app and starting it up again to see if that makes a difference. 

Link to comment

Hello!

Thanks for your workflow that I'm looking forward to use!

I have however the same problem as nd0:

17 hours ago, nd0 said:

image.thumb.png.5701c1e73383f7419aa52308684029c3.png

this has stopped working recently - I suspect this may have something to do with the introduction of Team Spaces on Notion?

 

btw thanks for this amazing workflow 

I followed the instructions, I have the latest version of the workflow but it doesn't search. However Notion opens in my browser when I click on Open Notion. 

Could it be that I don't have the right cookie or the right notionSpaceId? My cookie starts like this: “NEXT_LOCALE=fr-FR; notion_experiment...“. Is it normal?

Link to comment
14 minutes ago, Tgriso said:

Hello!

Thanks for your workflow that I'm looking forward to use!

I have however the same problem as nd0:

I followed the instructions, I have the latest version of the workflow but it doesn't search. However Notion opens in my browser when I click on Open Notion. 

Could it be that I don't have the right cookie or the right notionSpaceId? My cookie starts like this: “NEXT_LOCALE=fr-FR; notion_experiment...“. Is it normal?

 

Interesting. The cookie starts with the same text as mine, so it looks fine on that front, the important thing is that it contains the 'token_v2=' value. 

Some people are having issue with Python certificates, it might be worth checking this stack overflow answer just in case it fixes the issue. 

 

https://stackoverflow.com/questions/42098126/mac-osx-python-ssl-sslerror-ssl-certificate-verify-failed-certificate-verify

Link to comment
6 hours ago, wrjlewis said:

 

Welcome! It seems to be working as far I can tell. 

 

Have you got the latest version

Thanks for the quick reply, I do, just reinstalled just in case but getting the same issue. Does you notion space use teamspaces feature though? The feature is quite new and not everyone has started using it yet, so I just wanted to doublechek, as we have moved all of our stuff in notion into teamspaces recently.

Link to comment
35 minutes ago, nd0 said:

Thanks for the quick reply, I do, just reinstalled just in case but getting the same issue. Does you notion space use teamspaces feature though? The feature is quite new and not everyone has started using it yet, so I just wanted to doublechek, as we have moved all of our stuff in notion into teamspaces recently.

 

Thanks for double checking, I don't use team spaces and I'm not a part of an enterprise organisation anymore so I can't test this out (personal or personal pro accounts don't have team spaces), unless someone is able to facilitate that for me or patch the workflow code. 

It could be that team spaces is causing the issue, but impossible to tell without the above. 
 

Link to comment
On 9/20/2022 at 4:42 PM, wrjlewis said:

 

Thanks for double checking, I don't use team spaces and I'm not a part of an enterprise organisation anymore so I can't test this out (personal or personal pro accounts don't have team spaces), unless someone is able to facilitate that for me or patch the workflow code. 

It could be that team spaces is causing the issue, but impossible to tell without the above. 
 

Would be happy to facilitate in any way I can - not a developer, but other than that how can be of help?

Link to comment
12 minutes ago, nd0 said:

Strangely after reinstalling yet again I am now getting this errorimage.thumb.png.f4c93e9cc4799e84e45f1d7fea07a92b.png

Thanks for sharing.

 

I think your original issue, with team spaces, will persist after this error has been solved, unfortunately. Because I haven't been able to change anything relating to that.

This error is because I introuduced this line in order to accommodate for Korean and other languages.

 

alfredQuery = unicodedata.normalize('NFC',alfredQuery)

 

Some googling suggests that character U+201C Left Double Quotation Mark is not present in the Latin-1 (ISO-8859-1) encoding, which presents this error.

 

I don't know enough about unicode and latin-1 to fully understand this, so any help would be appreciated from someone who does.

Link to comment

I have Alfred 5 and the latest workflow. I ran the debugger and got the output below;

 

[08:37:51.177] Logging Started...
[08:38:00.126] Notion Search[Script Filter] Queuing argument ''
[08:38:00.350] Notion Search[Script Filter] Script with argv '(null)' finished
[08:38:00.353] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "Open Notion - No results, empty query, or error", "subtitle": "", "arg": "notion://www.notion.so/"}]}
[08:38:03.753] Notion Search[Script Filter] Queuing argument 'h'
[08:38:07.687] Notion Search[Script Filter] Script with argv '(null)' finished
[08:38:07.689] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "Open Notion - No results, empty query, or error", "subtitle": "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)", "arg": "notion://www.notion.so/"}]}
[08:38:10.923] Notion Search[Script Filter] Queuing argument 'ha'
[08:38:11.145] Notion Search[Script Filter] Queuing argument 'hab'
[08:38:11.353] Notion Search[Script Filter] Queuing argument 'haba'
[08:38:12.222] Notion Search[Script Filter] Script with argv '(null)' finished

Link to comment
17 minutes ago, Bladiko said:

I have Alfred 5 and the latest workflow. I ran the debugger and got the output below;

 

[08:37:51.177] Logging Started...
[08:38:00.126] Notion Search[Script Filter] Queuing argument ''
[08:38:00.350] Notion Search[Script Filter] Script with argv '(null)' finished
[08:38:00.353] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "Open Notion - No results, empty query, or error", "subtitle": "", "arg": "notion://www.notion.so/"}]}
[08:38:03.753] Notion Search[Script Filter] Queuing argument 'h'
[08:38:07.687] Notion Search[Script Filter] Script with argv '(null)' finished
[08:38:07.689] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "Open Notion - No results, empty query, or error", "subtitle": "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)", "arg": "notion://www.notion.so/"}]}
[08:38:10.923] Notion Search[Script Filter] Queuing argument 'ha'
[08:38:11.145] Notion Search[Script Filter] Queuing argument 'hab'
[08:38:11.353] Notion Search[Script Filter] Queuing argument 'haba'
[08:38:12.222] Notion Search[Script Filter] Script with argv '(null)' finished

 

After refreshing the cookie and spaceID now i'm getting this error;

 

position 512: ordinal not in range(256)", "arg": "notion://www.notion.so/"}]}
[08:53:44.194] Notion Search[Script Filter] Queuing argument 'habakkuk'
[08:53:44.344] Notion Search[Script Filter] Script with argv '(null)' finished
[08:53:44.379] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "Open Notion - No results, empty query, or error", "subtitle": "'latin-1' codec can't encode character '\\u2026' in position 512: ordinal not in range(256)", "arg": "notion://www.notion.so/"}]}

SCR-20220930-cho.png

Edited by Bladiko
Link to comment

Welcome @Bladiko,

 

4 hours ago, Bladiko said:

SSL: CERTIFICATE_VERIFY_FAILED

 

Looks like you installed Python manually. In that case you need to install the certificates too.

 

For reference, we have short instructions on how to install languages via Homebrew.

 

7 hours ago, Bladiko said:

After refreshing the cookie and spaceID now i'm getting this error;

 

That is explained in the post right above yours, by the workflow’s author.

 

@wrjlewis Text encodings has always been one Python’s sources of frustrations. There is somewhere in your code where text isn’t utf-8, but latin-1. Either it’s being converted to that, or misinterpreted, or retrieved as that. Anywhere where you’re doing byte string conversions is a good place to look. Try forcing text into utf-8, even where you think it already is, and you might find the issue.

 

Additionally, in your Script Filter you’re using with input as {query}. Don’t. Use with input as argv. There’s a reason it’s the default and it saves you from having to do character escaping, which is incomplete in your case (it’s missing backquotes and dollars). The code then becomes python3 notion.py "${1}"

Link to comment
38 minutes ago, vitor said:

Welcome @Bladiko,

 

 

Looks like you installed Python manually. In that case you need to install the certificates too.

 

For reference, we have short instructions on how to install languages via Homebrew.

 

 

That is explained in the post right above yours, by the workflow’s author.

 

@wrjlewis Text encodings has always been one Python’s sources of frustrations. There is somewhere in your code where text isn’t utf-8, but latin-1. Either it’s being converted to that, or misinterpreted, or retrieved as that. Anywhere where you’re doing byte string conversions is a good place to look. Try forcing text into utf-8, even where you think it already is, and you might find the issue.

 

Additionally, in your Script Filter you’re using with input as {query}. Don’t. Use with input as argv. There’s a reason it’s the default and it saves you from having to do character escaping, which is incomplete in your case (it’s missing backquotes and dollars). The code then becomes python3 notion.py "${1}"

Thank you for the response, I hadn't seen @wrjlewis response. i've changed the code to what you suggested and now i'm getting the image below; 

 

SCR-20220930-ok3.png

Edited by Bladiko
Link to comment
4 hours ago, vitor said:

Welcome @Bladiko,

 

 

Looks like you installed Python manually. In that case you need to install the certificates too.

 

For reference, we have short instructions on how to install languages via Homebrew.

 

 

That is explained in the post right above yours, by the workflow’s author.

 

@wrjlewis Text encodings has always been one Python’s sources of frustrations. There is somewhere in your code where text isn’t utf-8, but latin-1. Either it’s being converted to that, or misinterpreted, or retrieved as that. Anywhere where you’re doing byte string conversions is a good place to look. Try forcing text into utf-8, even where you think it already is, and you might find the issue.

 

Additionally, in your Script Filter you’re using with input as {query}. Don’t. Use with input as argv. There’s a reason it’s the default and it saves you from having to do character escaping, which is incomplete in your case (it’s missing backquotes and dollars). The code then becomes python3 notion.py "${1}"

 

Thanks for the explanation, thats helpful.

 

The problem I have now is that I'm unable to reproduce the error on my local machine. I've created a new page in notion, filled it with unicode characters such as “ and … which is referenced in the errors above, but I don't encounter an error when the results come back in the workflow.

Edited by wrjlewis
Link to comment
12 hours ago, wrjlewis said:

 

Thanks for the explanation, thats helpful.

 

The problem I have now is that I'm unable to reproduce the error on my local machine. I've created a new page in notion, filled it with unicode characters such as “ and … which is referenced in the errors above, but I don't encounter an error when the results come back in the workflow.

So I managed to install the certificates, I refreshed the cookie and then I duplicated the script filter to include the parameter @vitor had suggested. So one has python3 notion.py "{query}"  and the other python3 notion.py "${1}" 

In both instances i'm getting the error attached; 

I have a couple of questions,

  1. Does desktop Notion have to be open for this workflow to work? 
  2. On macOS 12.6 which is the best browser to get the cookie coz i seem to be getting different values depending on which browser i use. 

 

SCR-20221001-duv.png

Edited by Bladiko
Link to comment
1 minute ago, Bladiko said:

So I managed to install the certificates, I refreshed the cookie and then I duplicated the script filter to include the parameter @vitor had suggested. So one has python3 notion.py "{query}"  and the other python3 notion.py "${1}" 

In both instances i'm getting the error attached; my other question is, does desktop Notion have to be open for this workflow to work? 

SCR-20221001-duv.png

Hi

 

Thanks for trying but @vitorsuggestion is intended for me to make in combination with the fix for the Unicode issue, so your workflow won’t work until I make a change to the workflow (on top of the advice given). You will get odd error codes until that’s done. 

Link to comment
  • 2 weeks later...
On 7/19/2022 at 5:30 PM, vitor said:

Tried how? Don’t change the Workflow itself, it picks its own Python (3) version. But that error is not related to the language. If you installed Python 3 yourself (instead of letting macOS do it for you) you may need to install the certificates yourself too.

 

That version is still up for review. If you’re having an issue, use the one officially out.

This method is effective,it work , thank your help 

 

Edited by vitor
Replaced quoted test with true comment (English, instead of translated)
Link to comment
  • 4 weeks later...
5 hours ago, flymingo said:

hi there,my cookies is“notion_check_cookie_consent=false; token_v2=0d........” is not "notion browser cookies",can you help me please , what should I doimage.png.77a8176c7a9b35471ff2517e2d4f7e95.png

Can you copy everything after Cookie: in your screenshot, and use that as your cookie value to paste into the workflow environment variable

Link to comment
1 hour ago, Alex Kokol said:

Hello, since the new MacOS Update Venture v13. the search function doesn't work anymore.

Can anyone help me?

I presume Venture is still in public beta? So it's not supported yet.

Out of interest, what is the error you are getting, can you screenshot what happens when you try to search?

Link to comment
2 hours ago, Alex Kokol said:

Hello, since the new MacOS Update Venture v13. the search function doesn't work anymore.

Can anyone help me?

 

Not without information. Open the debugger, set the log output to “All Information”, perform the failing action, and post the output.

 

1 hour ago, wrjlewis said:

I presume Venture is still in public beta?

 

It’s been out of beta since October 24th.

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