Jump to content

Notion.so Instant Search Workflow


Recommended Posts

14 hours ago, dterranova said:

I just screengrabbed the contents of Chrome's headers. Redacted private data but made sure to keep all var definitions intact.... I wonder if this is due to Notion's Team functionality that others have mentioned, being that there's is no spaceId anymore? Excuse my ignorance, just spitballing.

EDIT: I tried copying notion_user_id into Alfred, just in case. No change.

 

EDIT 2: 

Found it! My bad.

Didn't realize spaceID is under the Payload tab, not Headers. 

It's there and it just started working! Thanks so much.
Just saved myself probably 15min per day with this workflow :)

 

Awesome! Really glad to hear it helps. I find it so useful personally!

Link to comment
  • 1 month later...

First of all, thank you for the great workflow. It runs great. I have only one question about the function "Show Recently Viewed". Unfortunately I don't get any results here. As soon as I search for a page, they are displayed. However, not the most recently used ones. If you only enter the command "ns" without anything behind it. Here is the debugger code. Maybe someone can help:

[11:28:36.785] Notion Search[Script Filter] Queuing argument ''
[11:28:36.923] Notion Search[Script Filter] Script with argv '(null)' finished
[11:28:36.930] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "Open Notion - No results, empty query, or error", "subtitle": " ", "arg": "https://www.notion.so/"}]}

 

image.png.6428cdad5dba141005fa0ed3f923f25e.png

Edited by Pirat
Link to comment
3 minutes ago, Pirat said:

First of all, thank you for the great workflow. It runs great. I have only one question about the function "Show Recently Viewed". Unfortunately I don't get any results here. As soon as I search for a page, they are displayed. However, not the most recently used ones. If you only enter the command "ns" without anything behind it. Here is the debugger code. Maybe someone can help:

[11:28:36.785] Notion Search[Script Filter] Queuing argument ''
[11:28:36.923] Notion Search[Script Filter] Script with argv '(null)' finished
[11:28:36.930] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "Open Notion - No results, empty query, or error", "subtitle": " ", "arg": "https://www.notion.so/"}]}

 

image.png.6428cdad5dba141005fa0ed3f923f25e.png

 

Pleased to hear it's working (mostly) well! 

 

For the "Show Recently Viewed" function to work, you need to make sure that in your cookie you have a user id value. This will be the case if you have copied the whole cookie value from your browser rather than just the token_v2. 

 

Have you got user_id in your cookie? (don't paste your cookie here because the information is sensitive)

Link to comment

Thank you for the quick reply.

I have used chrome to get the values (I did after I typed "search" in notion in the search box). Took the complete value at "request headers" after "cookie:". Among other things, the field "cb_user_id" and "notion_user_id" is also included here. After the value "notion_user_id=" is a letter number sequence separated by dashes. So everything looks good for now.

 

I have also already copied the cookies first to a text file and then to Alfred.

 

In addition, the "Show recently Viewed" is checked in the workflow.


There is no field with only "user_id". Only the fields "cb_user_id" and "notion_user_id"

 

Link to comment
3 hours ago, Pirat said:

Thank you for the quick reply.

I have used chrome to get the values (I did after I typed "search" in notion in the search box). Took the complete value at "request headers" after "cookie:". Among other things, the field "cb_user_id" and "notion_user_id" is also included here. After the value "notion_user_id=" is a letter number sequence separated by dashes. So everything looks good for now.

 

I have also already copied the cookies first to a text file and then to Alfred.

 

In addition, the "Show recently Viewed" is checked in the workflow.


There is no field with only "user_id". Only the fields "cb_user_id" and "notion_user_id"

 

 

Ah thanks, yes the right one is notion_user_id.

 

This could be related to a bug that I haven't released a fix to in relation to the way python handles cookies. Basically if there is a curly brace '{' or a '}' in the cookie somewhere, the code will not read anything after this point. 

 

Could you check if there is a curly brace in your cookie somewhere, and if so delete that whole part of the cookie. Most likely you will need to delete everything from and including 'notion_cookie_consent'= to and including the next semi colon ';' .  That should cover removing all values that have a curly braces. 

 

Try again with you have left, and I wonder if that will work for you now. 

Link to comment

Thank you for the quick reply. I have changed it and now everything works. In fact, the symbols were there. I have changed these in the field "g_state=" and "notion_cookie_consent=".
 

Now everything runs smoothly and makes my everyday life much easier.
 

I have one more small hint. It's nothing important, but maybe it helps. With me it is so that I use the desktop app of Notion on a Mac. If the desktop app was not yet open and I then open a Notion page via Alfred, the Notion app starts and the correct page opens. Everything is fine.
This is also the case when Notion is minimized, after the command "CMD" + "M". The desired page is opened by the Alfred workflow and the Notion app appears. Everything is fine.
However, if Notion is open and closed by "CMD" + "W". So the app is still running in the background, but it is not minimized as a window, then you can't open the Notion page directly via the workflow in Aflred anymore, but you have to restart the desktop app once before. So that again the window of the Notion app is open. I suspect, however, that the problem is not in the workflow.

Thanks again for providing the workflow.

Link to comment
2 hours ago, Pirat said:

Thank you for the quick reply. I have changed it and now everything works. In fact, the symbols were there. I have changed these in the field "g_state=" and "notion_cookie_consent=".
 

Now everything runs smoothly and makes my everyday life much easier.
 

I have one more small hint. It's nothing important, but maybe it helps. With me it is so that I use the desktop app of Notion on a Mac. If the desktop app was not yet open and I then open a Notion page via Alfred, the Notion app starts and the correct page opens. Everything is fine.
This is also the case when Notion is minimized, after the command "CMD" + "M". The desired page is opened by the Alfred workflow and the Notion app appears. Everything is fine.
However, if Notion is open and closed by "CMD" + "W". So the app is still running in the background, but it is not minimized as a window, then you can't open the Notion page directly via the workflow in Aflred anymore, but you have to restart the desktop app once before. So that again the window of the Notion app is open. I suspect, however, that the problem is not in the workflow.

Thanks again for providing the workflow.

 

Thanks @Pirat

 

Yeah the second issue you notice is one we're aware of:

https://github.com/wrjlewis/notion-search-alfred-workflow/issues/73

It's frustrating, I think it's related to the notion app rather than the alfred workflow. Is there any other way you can trigger the desktop app to open a page, and does it exhibit the same behaviour? 

Link to comment

I have trouble getting it to run after updating on the latest MacOS. 

 

I tried the certificates command and get

sudo: /Applications/Python 3.9/Install Certificates.command: command not found
 ~ % python --version
zsh: command not found: python
 ~ %

 

I also reinstalled Python 3 and then Python 2 via homebrew as explained here:

https://www.alfredapp.com/help/kb/install-dependencies/

 

No success. I always get this error message:

[13:54:27.046] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "There was an error:", "subtitle": "253: 'Payload' object has no attribute 'pages'", "arg": "notion://www.notion.so/"}]}

 

Has anyone an idea how to solve this?

Link to comment
49 minutes ago, nebaon said:

I have trouble getting it to run after updating on the latest MacOS. 

 

I tried the certificates command and get

sudo: /Applications/Python 3.9/Install Certificates.command: command not found
 ~ % python --version
zsh: command not found: python
 ~ %

 

I also reinstalled Python 3 and then Python 2 via homebrew as explained here:

https://www.alfredapp.com/help/kb/install-dependencies/

 

No success. I always get this error message:

[13:54:27.046] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "There was an error:", "subtitle": "253: 'Payload' object has no attribute 'pages'", "arg": "notion://www.notion.so/"}]}

 

Has anyone an idea how to solve this?

 

Have you tried running the command with the quotes? 
 

sudo '/Applications/Python 3.9/Install Certificates.command'
 

The single quotes are required. If this file doesn't exist, run "python --version" to find out what version you have and update command accordingly.

If you installed python homebrew it might be that you don't have the Install Certificates script, you might want to try running: 

pip install certifi

However, the error message you're getting doesn't show the certificate error. So I'd suggest refreshing your notion cookie and space id, in addition to the above steps. 

Link to comment

Hello,

 

great that you answer that fast, thanks a million.

 

It does not seem solvable though. 

I tried the commands but somethings seems to be off:

Last login: Fri Apr 14 14:29:33 on ttys000
 ~ % sudo '/Applications/Python 3.9/Install Certificates.command'

Password:
sudo: /Applications/Python 3.9/Install Certificates.command: command not found
 ~ % pip install certifi

zsh: command not found: pip
 ~ % 

 

I will try to update Cookie / SpaceID later on.

 

Thanks again, 

 David

Link to comment
  • 1 month later...

I might have a similar error as people before me, but I couldnt find the exact one and the tips didn't do it for me. Here is the debugger:

[22:08:09.602] Notion Search[Script Filter] Queuing argument ''
[22:08:10.060] Notion Search[Script Filter] Script with argv '(null)' finished
[22:08:10.069] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "Open Notion - No results, empty query, or error", "subtitle": " ", "arg": "notion://www.notion.so/"}]}
[22:08:10.113] Notion Search[Script Filter] Queuing argument 'h'
[22:08:10.257] Notion Search[Script Filter] Queuing argument 'hu'
[22:08:10.388] Notion Search[Script Filter] Queuing argument 'hus'
[22:08:10.501] Notion Search[Script Filter] Script with argv '(null)' finished
[22:08:10.507] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "There was an error:", "subtitle": "291: 'Payload' object has no attribute 'results'", "arg": "notion://www.notion.so/"}]}
[22:08:11.000] Notion Search[Script Filter] Script with argv '(null)' finished
[22:08:11.006] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "There was an error:", "subtitle": "291: 'Payload' object has no attribute 'results'", "arg": "notion://www.notion.so/"}]}

Link to comment
2 minutes ago, alsbjer said:

I might have a similar error as people before me, but I couldnt find the exact one and the tips didn't do it for me. Here is the debugger:

[22:08:09.602] Notion Search[Script Filter] Queuing argument ''
[22:08:10.060] Notion Search[Script Filter] Script with argv '(null)' finished
[22:08:10.069] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "Open Notion - No results, empty query, or error", "subtitle": " ", "arg": "notion://www.notion.so/"}]}
[22:08:10.113] Notion Search[Script Filter] Queuing argument 'h'
[22:08:10.257] Notion Search[Script Filter] Queuing argument 'hu'
[22:08:10.388] Notion Search[Script Filter] Queuing argument 'hus'
[22:08:10.501] Notion Search[Script Filter] Script with argv '(null)' finished
[22:08:10.507] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "There was an error:", "subtitle": "291: 'Payload' object has no attribute 'results'", "arg": "notion://www.notion.so/"}]}
[22:08:11.000] Notion Search[Script Filter] Script with argv '(null)' finished
[22:08:11.006] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "There was an error:", "subtitle": "291: 'Payload' object has no attribute 'results'", "arg": "notion://www.notion.so/"}]}

Hi, just to check because it’s surprising how often this fixes this issue, have you tried re obtaining your cookie and space id? Thanks 

Link to comment
9 hours ago, wrjlewis said:

Hi, just to check because it’s surprising how often this fixes this issue, have you tried re obtaining your cookie and space id? Thanks 

Hi!

Yes, I've tried multiple times in multiple browsers. I also tried to exclude parts with {} but unfortunately I get the same error. My cookie is much longer than in the tutorial example, which parts of the cookie is needed?

Edited by alsbjer
Link to comment

Absolutely amazing workflow! 🙏  Been using it every day for a couple of weeks and it is now indispensable. Thank you so much.

 

I don't know whether you're open to requests, or whether this has been asked, but it would be terrific to be able to copy the URL of a Notion page by using a modifier key and hitting enter in Alfred. So you'd type NS


and instead of hitting Enter to take you there, you hit Alt or Opt or Shift or something and Enter, and it copies the URL instead. Don't know about others but would be terrific for my use case.

 

Again, thanks so much!

 

 

Link to comment
23 minutes ago, hug101 said:

Absolutely amazing workflow! 🙏  Been using it every day for a couple of weeks and it is now indispensable. Thank you so much.

 

I don't know whether you're open to requests, or whether this has been asked, but it would be terrific to be able to copy the URL of a Notion page by using a modifier key and hitting enter in Alfred. So you'd type NS


and instead of hitting Enter to take you there, you hit Alt or Opt or Shift or something and Enter, and it copies the URL instead. Don't know about others but would be terrific for my use case.

 

Again, thanks so much!

 

 

This is actually already possible I think! Try the Mac key (cmd) and enter, it should copy to the clipboard? Glad it’s been really helpful

Link to comment
6 hours ago, alsbjer said:

Hi!

Yes, I've tried multiple times in multiple browsers. I also tried to exclude parts with {} but unfortunately I get the same error. My cookie is much longer than in the tutorial example, which parts of the cookie is needed?

Specifically the token_v2 bit, but as long as that’s in your cookie somewhere, it should be fine 

Link to comment
On 5/19/2023 at 8:12 AM, wrjlewis said:

This is actually already possible I think! Try the Mac key (cmd) and enter, it should copy to the clipboard? Glad it’s been really helpful

Thanks for the reply but that does not work on my end. The other modifier keys have different functions, too. 'option' searches in Finder and 'control' searches with something called 'default fallback'. Any suggestions?

Link to comment
9 hours ago, hug101 said:

Thanks for the reply but that does not work on my end. The other modifier keys have different functions, too. 'option' searches in Finder and 'control' searches with something called 'default fallback'. Any suggestions?

Ah thats strange, I was almost sure I was able to do that at some point. 

 

Either way, I've found how to do it and will add it to the next release. I'm not sure when that will be, I tend to add a few features then go through the process of releasing a new version of the workflow. But you can track that here https://github.com/wrjlewis/notion-search-alfred5-workflow/issues/6

 

Thanks for the suggestion

Link to comment
On 5/22/2023 at 10:10 AM, wrjlewis said:

Ah thats strange, I was almost sure I was able to do that at some point. 

 

Either way, I've found how to do it and will add it to the next release. I'm not sure when that will be, I tend to add a few features then go through the process of releasing a new version of the workflow. But you can track that here https://github.com/wrjlewis/notion-search-alfred5-workflow/issues/6

 

Thanks for the suggestion

 

This would be terrific and much appreciated. Again, kudos on releasing such a fantastic workflow. It's really appreciated!

Link to comment
  • 2 weeks later...
On 5/23/2023 at 4:10 PM, hug101 said:

 

This would be terrific and much appreciated. Again, kudos on releasing such a fantastic workflow. It's really appreciated!

 

This is now in the latest update as well, if you wouldn't mind confirming its working for you? CMD+Enter on a search result

Link to comment

Hi there! First of all, thanks for building this workflow. It's the thing on my mac I use the most and can't imagine living without it anymore!

 

Except that I have to now, as, it's not working anymore since yesterday 😅.

 

Whenever I bring it up to search my Notion workspace I get this error message and hitting enter just brings to my start page:

261: 'Payload' object has no attribute 'pages'

 

Up until now, the workflow was working perfectly fine. I updated the Cookie and Space ID yesterday and it worked again, but only until this morning.  Any idea what might have happened? I updated the workflow just a few days ago - maybe there is an issue with the update?

 

Any help is appreciated!

Link to comment
Yeah this has been reported several times today, looks like there’s been a breaking change of some sort on notions side. 
 
Im on holiday at the moment, so can’t debug it further until next weekend. bad timing I’m afraid! 
 
If anyone wants to figure it out in the meantime, I would start with printing the raw search response from notion, convert to json to pull it apart easily, and seeing where it doesn’t match with what the code is expecting / trying to parse.
Link to comment

can someone help me? my notion search is showing the error: "'payload' objects have no attributable results"

 

[10:30:09.017] Logging Started...
[10:32:32.059] Notion Search[Script Filter] Queuing argument ''
[10:32:32.861] Notion Search[Script Filter] Script with argv '(null)' finished
[10:32:32.865] Notion Search[Script Filter] {"items": [{"type": "default", "title": "Google Search Console", "arg": "notion://www.notion.so/1550907ce04241e8bd8060e56c9a2a66", "subtitle": "Meeting Notes / OKR TRACKER - 7 DECEMBER 2022 / SEO List ", "autocomplete": "Google Search Console"}, {"type": "default", "title": "                                                                                                                                                            Zodiac PBN", "arg": "notion://www.notion.so/bbff88e59eb74d878918056073358cf8", "subtitle": "Dashboard / Projects / Projects ", "icon": {"path": "emojiicons/1f522.png"}, "autocomplete": "                                                                                                                                                            Zodiac PBN"}, {"type": "default", "title": "Tasks", "arg": "notion://www.notion.so/2a98dffbc4cc4954a9f80203f7a83ac5", "subtitle": "Dashboard ", "icon": {"path": "emojiicons/1f41b.png"}, "autocomplete": "Tasks"}, {"type": "default", "title": "Books", "arg": "notion://www.notion.so/88840a09722f4422a54ae1c658870eca", "subtitle": "", "icon": {"path": "emojiicons/1f4da.png"}, "autocomplete": "Books"}, {"type": "default", "title": "Areas (Dashboard)", "arg": "notion://www.notion.so/e511d63b42e54211a5518f31ffb0e6cc", "subtitle": "Dashboard ", "icon": {"path": "emojiicons/1f9d1.png"}, "autocomplete": "Areas (Dashboard)"}, {"type": "default", "title": "Projects", "arg": "notion://www.notion.so/1440c86fe3f84a1eafed749058c94e70", "subtitle": "Dashboard ", "icon": {"path": "emojiicons/1f98b.png"}, "autocomplete": "Projects"}, {"type": "default", "title": "Dashboard", "arg": "notion://www.notion.so/b0f8e72955e749c2a45368e081206147", "subtitle": "", "icon": {"path": "emojiicons/1f3c1.png"}, "autocomplete": "Dashboard"}, {"type": "default", "title": "Cargill - Kartika", "arg": "notion://www.notion.so/cb142bae22a547d7b9d86065778c8339", "subtitle": "Invoice and Quotation ", "autocomplete": "Cargill - Kartika"}, {"type": "default", "title": "Invoice and Quotation", "arg": "notion://www.notion.so/9c4ace8630fa44cfa7a8d15a41b87db7", "subtitle": "", "icon": {"path": "emojiicons/1f4b3.png"}, "autocomplete": "Invoice and Quotation"}]}
[10:32:34.076] Notion Search[Script Filter] Queuing argument 'o'
[10:32:34.179] Notion Search[Script Filter] Queuing argument 'ok'
[10:32:34.259] Notion Search[Script Filter] Queuing argument 'okr'
[10:32:34.772] Notion Search[Script Filter] Script with argv '(null)' finished
[10:32:34.780] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "There was an error:", "subtitle": "299: 'Payload' object has no attribute 'results'", "arg": "notion://www.notion.so/"}]}
[10:32:35.253] Notion Search[Script Filter] Script with argv '(null)' finished
[10:32:35.262] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "There was an error:", "subtitle": "299: 'Payload' object has no attribute 'results'", "arg": "notion://www.notion.so/"}]}
[10:33:11.142] Notion Search[Script Filter] Queuing argument ''
[10:33:11.380] Notion Search[Script Filter] Queuing argument 'b'
[10:33:11.524] Notion Search[Script Filter] Queuing argument 'bo'
[10:33:11.601] Notion Search[Script Filter] Script with argv '(null)' finished
[10:33:11.606] Notion Search[Script Filter] {"items": [{"type": "default", "title": "Google Search Console", "arg": "notion://www.notion.so/1550907ce04241e8bd8060e56c9a2a66", "subtitle": "Meeting Notes / OKR TRACKER - 7 DECEMBER 2022 / SEO List ", "autocomplete": "Google Search Console"}, {"type": "default", "title": "                                                                                                                                                            Zodiac PBN", "arg": "notion://www.notion.so/bbff88e59eb74d878918056073358cf8", "subtitle": "Dashboard / Projects / Projects ", "icon": {"path": "emojiicons/1f522.png"}, "autocomplete": "                                                                                                                                                            Zodiac PBN"}, {"type": "default", "title": "Tasks", "arg": "notion://www.notion.so/2a98dffbc4cc4954a9f80203f7a83ac5", "subtitle": "Dashboard ", "icon": {"path": "emojiicons/1f41b.png"}, "autocomplete": "Tasks"}, {"type": "default", "title": "Books", "arg": "notion://www.notion.so/88840a09722f4422a54ae1c658870eca", "subtitle": "", "icon": {"path": "emojiicons/1f4da.png"}, "autocomplete": "Books"}, {"type": "default", "title": "Areas (Dashboard)", "arg": "notion://www.notion.so/e511d63b42e54211a5518f31ffb0e6cc", "subtitle": "Dashboard ", "icon": {"path": "emojiicons/1f9d1.png"}, "autocomplete": "Areas (Dashboard)"}, {"type": "default", "title": "Projects", "arg": "notion://www.notion.so/1440c86fe3f84a1eafed749058c94e70", "subtitle": "Dashboard ", "icon": {"path": "emojiicons/1f98b.png"}, "autocomplete": "Projects"}, {"type": "default", "title": "Dashboard", "arg": "notion://www.notion.so/b0f8e72955e749c2a45368e081206147", "subtitle": "", "icon": {"path": "emojiicons/1f3c1.png"}, "autocomplete": "Dashboard"}, {"type": "default", "title": "Cargill - Kartika", "arg": "notion://www.notion.so/cb142bae22a547d7b9d86065778c8339", "subtitle": "Invoice and Quotation ", "autocomplete": "Cargill - Kartika"}, {"type": "default", "title": "Invoice and Quotation", "arg": "notion://www.notion.so/9c4ace8630fa44cfa7a8d15a41b87db7", "subtitle": "", "icon": {"path": "emojiicons/1f4b3.png"}, "autocomplete": "Invoice and Quotation"}]}
[10:33:11.650] Notion Search[Script Filter] Queuing argument 'boo'
[10:33:11.706] Notion Search[Script Filter] Queuing argument 'book'
[10:33:11.782] Notion Search[Script Filter] Queuing argument 'books'
[10:33:12.008] Notion Search[Script Filter] Script with argv '(null)' finished
[10:33:12.017] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "There was an error:", "subtitle": "299: 'Payload' object has no attribute 'results'", "arg": "notion://www.notion.so/"}]}
[10:33:12.464] Notion Search[Script Filter] Script with argv '(null)' finished
[10:33:12.477] Notion Search[Script Filter] {"items": [{"uid": 1, "type": "default", "title": "There was an error:", "subtitle": "299: 'Payload' object has no attribute 'results'", "arg": "notion://www.notion.so/"}]}

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