Notion API,更新頁面的圖示表情符號

以下是使用Notion API更新Notion頁面的圖示表情符號的方法。 假設您已經初始化了Notion客戶端: import { Client } from '@notionhq/client' //... const notion = new Client({ auth: process.env.NOTION_API_KEY }) 假設頁面id存儲在page_id變量中。 然後,您可以這樣做將頁面圖示的值設置為新的表情符號: await notion.pages.update({ page_id: page_id, icon: { type: 'emoji', emoji: '✅', }, })

在 macOS Finder 中添加“在 VS Code 中打开”图标

假设我在 Finder 中,打开一个文件夹,并且想要在 VS Code 中打开它。 我该怎么做呢?通常情况下,我会转到上一级文件夹,拖动该文件夹并将其放入 Dock 中的 VS Code 图标中。 或者我会转到终端并输入 code . 但是,今天我花费了一些时间,让这个过程变得更容易,通过在 Finder 工具栏中添加一个按钮: 下面是你也可以这样做的方法。 打开 Automator,选择“应用程序” 在动作列表中搜索“运行 Shell 脚本”,并粘贴以下两行: finderPath=`osascript -e 'tell application "Finder" to get the POSIX path of (target of front window as alias)'` open -n -a "Visual Studio Code" --args "$finderPath" 如果你愿意,你也可以使用应用程序的 Bundle ID: finderPath=`osascript -e 'tell application "Finder" to get the POSIX path of (target of front window as alias)'` open -n -b "com....