Project Icon

notion-search-alfred-workflow

Alfred工作流实现Notion页面快速搜索与访问

这是一个为Alfred开发的工作流,实现了Notion的即时搜索功能。用户能够通过Alfred迅速查找Notion中的页面和内容,查看最近浏览的页面,并直接打开搜索结果。工作流还具备复制页面URL、创建新页面等功能,支持自动更新。用户可自定义工作流变量,包括使用桌面客户端打开链接、显示图标等选项。该工作流安装简便,搜索流畅,有助于Notion用户提升工作效率。

notion-search-alfred-workflow

An Alfred workflow to search Notion.so with instant results

img

Alfred 5 version

Github Repository

Latest Download

Alfred 4 version

Github Repository

Latest Download

Simply type your keyword into Alfred (default: ns) and provide a query to see instant search results from Notion that mimic the Quick Find function in the Notion webapp.

Pressing enter on a search result takes you to that page in Notion in your default web browser or notion app.

Hold Cmd + press enter on any search result to copy the url to your clipboard.

Additional features

  • Comes with pre-configured support for OneUpdater for automatic version updates.

  • The workflow also provides the ability to quickly see your recently viewed pages. Simply type the 'ns' keyword to start the workflow, as you would before you search, and your most recently viewed notion pages are displayed.

  • Open a new notion page by typing 'nsn', this only supports the web app currently, it's very handy!

img

Workflow Variables

  • cookie: Needed for your Notion token.
  • notionSpaceId: Your organisation identifier.
  • useDesktopClient: Defaults to False. Determines whether to open Notion links in the desktop client rather than the web app.

It's recommended to leave the following variables to their defaults, unless you're confident:

  • isNavigableOnly: Defaults to False. This settings allows you to search objects within a page, ie notion objects that cannot be found through the left hand side navigation pane. Setting to True only returns results that can be found through the left hand side navigation pane, but removes subtitles from Alred search results.
  • enableIcons: Defaults to True. This toggles support for Notion icons to be shown natively in Alfred search results, for a better design/UX experience. Custom Notion icons are downloaded on demand.
  • iconCacheDays: Defaults to the recommended value of 365 days for the best performance. Defines the number of days to cache custom icons. Min 0, max 365.
  • showRecentlyViewedPages: Defaults to True. This toggle determines if recently viewed pages should be shown when there is no query provided by the user and the user id is present in the supplied cookie (user id is needed for the api call to show recently viewed pages).

Install Steps

Install Python3

Many people will have Python3 already on their machine, if you haven't you can try to run python3 from a Terminal window and it should prompt you to install the Xcode CLI tools automatically (which include Python).

Otherwise you can read a more detailed guide on installing Python here.

Install cairosvg (optional)

Installing cairosvg will allow svg icons to be shown in Alfred search results, providing a more visually appealing experience. Open terminal and run the following command:

pip3 install cairosvg

Install cairosvgs's dependency, cairo. With Homebrew for example:

brew install cairo

If you haven't used homebrew before, you may want to skip this optional step or install homebrew (easy with a quick google search).

UPDATE: There seems to be an issue with cairosvg on apple silicon, use this fix at your own risk but this worked for me and now SVG icons show again:

brew install cairo pango gdk-pixbuf libxml2 libxslt libffi
sudo mkdir /usr/local/lib/
sudo ln -s /opt/homebrew/lib/libcairo-2.dll /usr/local/lib/libcairo-2.dll
sudo ln -s /opt/homebrew/lib/libcairo.so.2 /usr/local/lib/libcairo.so.2
sudo ln -s /opt/homebrew/lib/libcairo.2.dylib /usr/local/lib/libcairo.2.dylib

Get your workflow variables

I recommend using chrome to retrieve these values. If you can only use safari you can copy the 'token_v2' value by following the equivalent steps above and populating the cookie env variable in Alfred so it looks like this token_v2=XXXXXXXXXXXX (however this means the recently viewed pages feature will not work for you).

Visit the Notion webapp and use your browser developer tools to see the network requests being made when you type in anything to the quick find search bar. In Chrome select 'View' in the toolbar > Developer > Developer Tools. Then select the Network tab in the developer tools window.

Here you'll see a request called search, check the request headers to copy the cookie value and check the request payload to copy your notionSpaceId, as shown in the screenshots below.

Known issue: Some users have experienced issues with copying these values directly from developer tools, but have seen success by copying and pasting the values into TextEdit or a different text editor first, this probably "strips out" or removes any problematic formatting.

img

Get your cookie headers They should look something like this

notion_browser_id=1bcfbfb9-e98c-9f03; logglytrbckingsession=eb1c82cb-fd; bjs_bnonymous_id=%22bdbf1088-b33c-9bdb-b67c-1e; _fbp=fb.1.12821; intercom-id-gpfdrxfd=b61ec62d-; token_v2=b39099...

img

Get your spaceId It should look something like this

celcl9aa-c3l7-7504-ca19-0c985e34ll8d

img

Install the Notion Alfred worflow

Download and double click the latest release for your version of Alfred, following the links at the top of this page.

Add these values to the Notion Alfred workflow

In the Alfred worfklow in the upper right corner click the [x] icon and add the values from above to the corresponding value field

img

Troubleshooting

The script may fail due to an SSL error. If the script isn't working, turn on debugging by clicking on the little cockroach in the alfred workflow screen. If you see an error like:

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: .....

Run this from the terminal app:

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 the directory accordingly.

Tips

  • If you prefer using the Mac app of Notion, set the useDesktopClient environment variable in Alfred to True.
  • If you experience performance issues or slow searches, you may wish to set enableIcons to false. This changes the search results design so icons are in line with the title, it also disables the downloading of any Notion custom icons that you come across whilst searching.

Download:

Follow the links at the top of this page.

Forum topics:

https://www.alfredforum.com/topic/14451-notionso-instant-search-workflow/ https://www.reddit.com/r/NotionSo/comments/f58u1y/notionso_instant_search_workflow_for_alfred/

项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

AI写歌

Suno AI是一个革命性的AI音乐创作平台,能在短短30秒内帮助用户创作出一首完整的歌曲。无论是寻找创作灵感还是需要快速制作音乐,Suno AI都是音乐爱好者和专业人士的理想选择。

Project Cover

白日梦AI

白日梦AI提供专注于AI视频生成的多样化功能,包括文生视频、动态画面和形象生成等,帮助用户快速上手,创造专业级内容。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

Kimi

Kimi AI助手提供多语言对话支持,能够阅读和理解用户上传的文件内容,解析网页信息,并结合搜索结果为用户提供详尽的答案。无论是日常咨询还是专业问题,Kimi都能以友好、专业的方式提供帮助。

Project Cover

讯飞绘镜

讯飞绘镜是一个支持从创意到完整视频创作的智能平台,用户可以快速生成视频素材并创作独特的音乐视频和故事。平台提供多样化的主题和精选作品,帮助用户探索创意灵感。

Project Cover

讯飞文书

讯飞文书依托讯飞星火大模型,为文书写作者提供从素材筹备到稿件撰写及审稿的全程支持。通过录音智记和以稿写稿等功能,满足事务性工作的高频需求,帮助撰稿人节省精力,提高效率,优化工作与生活。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

AIWritePaper论文写作

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号