Onenote

From malue-ai/dazee-small · View interactive version

Onenote is an AI agent skill from the GitHub repository malue-ai/dazee-small. Manage Microsoft OneNote on Windows via PowerShell COM objects. Create, search, and read notes across notebooks and sections.

How to use this skill

Skill file

OneNote 笔记管理(Windows)

通过 PowerShell 控制 Windows 上的 Microsoft OneNote。

使用场景

命令参考

列出笔记本

$onenote = New-Object -ComObject OneNote.Application
[xml]$hierarchy = ""
$onenote.GetHierarchy("", [Microsoft.Office.Interop.OneNote.HierarchyScope]::hsNotebooks, [ref]$hierarchy)

$hierarchy.Notebooks.Notebook | ForEach-Object {
    Write-Output "📓 $($_.name)"
    $_.Section | ForEach-Object {
        Write-Output "  📑 $($_.name)"
    }
}

搜索笔记

$onenote = New-Object -ComObject OneNote.Application
[xml]$results = ""
$onenote.FindPages("", "搜索关键词", [ref]$results)

$results.Pages.Page | ForEach-Object {
    Write-Output "$($_.name) — $($_.dateTime)"
}

创建新页面

$onenote = New-Object -ComObject OneNote.Application

# 获取目标 Section ID
[xml]$hierarchy = ""
$onenote.GetHierarchy("", [Microsoft.Office.Interop.OneNote.HierarchyScope]::hsSections, [ref]$hierarchy)
$sectionId = ($hierarchy.Notebooks.Notebook.Section | Where-Object { $_.name -eq "目标分区" }).ID

# 创建页面
$pageXml = @"
<?xml version="1.0"?>
<one:Page xmlns:one="http://schemas.microsoft.com/office/onenote/2013/onenote">
  <one:Title>
    <one:OE><one:T><![CDATA[笔记标题]]></one:T></one:OE>
  </one:Title>
  <one:Outline>
    <one:OEChildren>
      <one:OE><one:T><![CDATA[笔记内容]]></one:T></one:OE>
    </one:OEChildren>
  </one:Outline>
</one:Page>
"@

$onenote.CreateNewPage($sectionId, [ref]$null)

注意

安全规则

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.