Keynote Creator by nevamind-ai/memubot
npx skills add https://github.com/nevamind-ai/memubot --skill 'Keynote Creator'本技能指导您如何使用 AppleScript 在 macOS 上创建和操作 Keynote 演示文稿。
当用户要求以下操作时,创建 Keynote 演示文稿:
macos_show(app: "keynote")务必使用单个 AppleScript 来创建整个演示文稿。 不要运行多个独立的脚本。
为什么这很重要:
osascript 调用都可能重启 Keynote 的脚本桥接错误做法(导致崩溃):
# Script 1: Create document
osascript -e 'tell application "Keynote" to make new document'
# Script 2: Add slide 1
osascript -e 'tell application "Keynote" to tell front document to make new slide'
# Script 3: Set title
osascript -e 'tell application "Keynote" to tell front document to ...'
# This will likely crash!
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
正确做法(稳定):
osascript << 'EOF'
tell application "Keynote"
activate
delay 1 -- Wait for Keynote to fully launch
-- Do ALL operations in ONE script
set newDoc to make new document with properties {document theme:theme "White"}
delay 0.5 -- Brief pause after creating document
tell newDoc
-- All slides and content in one block
...
end tell
end tell
EOF
必需的延迟:
activate 之后:delay 1(让应用完全启动)make new document 之后:delay 0.5delay 0.3(可选,但对于多张幻灯片推荐使用)osascript << 'EOF'
tell application "Keynote"
activate
set newDoc to make new document with properties {document theme:theme "White"}
return name of newDoc
end tell
EOF
可用主题:"White"、"Black"、"Gradient"、"Classic"、"Modern Type"、"Showcase"、"Photo Essay"、"Bold"、"Industrial"、"Blueprint"
osascript << 'EOF'
tell application "Keynote"
tell front document
-- Add slide with specific layout
set newSlide to make new slide with properties {base slide:master slide "Title - Center"}
end tell
end tell
EOF
常用母版幻灯片(布局):
"Title - Center" - 标题和副标题居中"Title - Top" - 标题在顶部,带有内容区域"Title & Subtitle" - 经典标题幻灯片"Title & Bullets" - 带项目符号的标题"Title, Bullets & Photo" - 标题、项目符号和图像"Bullets" - 全页项目符号"Photo" - 全页图像"Photo - Horizontal" - 横向照片布局"Quote" - 引用布局"Blank" - 空白幻灯片osascript << 'EOF'
tell application "Keynote"
tell front document
tell current slide
-- Set title
set object text of default title item to "Your Title Here"
-- Set body text (for slides with body placeholder)
set object text of default body item to "• Point 1
• Point 2
• Point 3"
end tell
end tell
end tell
EOF
osascript << 'EOF'
tell application "Keynote"
tell front document
tell current slide
set newText to make new text item with properties {object text:"Custom text here"}
set position of newText to {100, 200}
set width of newText to 400
set height of newText to 100
end tell
end tell
end tell
EOF
osascript << 'EOF'
tell application "Keynote"
tell front document
tell current slide
set imgFile to POSIX file "/path/to/image.jpg"
set newImage to make new image with properties {file:imgFile}
set position of newImage to {300, 200}
set width of newImage to 400
end tell
end tell
end tell
EOF
osascript << 'EOF'
tell application "Keynote"
tell front document
set current slide to slide 3
end tell
end tell
EOF
osascript -e 'tell application "Keynote" to count slides of front document'
osascript << 'EOF'
tell application "Keynote"
tell front document
set exportPath to POSIX file "/Users/username/Desktop/presentation.pdf"
export to exportPath as PDF
end tell
end tell
EOF
osascript << 'EOF'
tell application "Keynote"
tell front document
set savePath to POSIX file "/Users/username/Desktop/my_presentation.key"
save in savePath
end tell
end tell
EOF
这是推荐模式 - 所有操作在一个脚本中,并带有适当的延迟:
osascript << 'EOF'
tell application "Keynote"
activate
delay 1 -- IMPORTANT: Wait for Keynote to fully launch
-- Create new document
set newDoc to make new document with properties {document theme:theme "White"}
delay 0.5 -- Wait for document to initialize
tell newDoc
-- First slide is created automatically, set it as title slide
tell slide 1
set base slide to master slide "Title - Center"
set object text of default title item to "Q1 2026 Business Review"
set object text of default body item to "Financial Services Division"
end tell
delay 0.3
-- Add Overview slide
set slide2 to make new slide with properties {base slide:master slide "Title & Bullets"}
delay 0.3
tell slide2
set object text of default title item to "Executive Summary"
set object text of default body item to "• Revenue increased 15% YoY
• New client acquisition: $15M AUM
• Client satisfaction: 4.8/5.0
• All portfolios outperforming benchmarks"
end tell
-- Add Performance slide
set slide3 to make new slide with properties {base slide:master slide "Title & Bullets"}
delay 0.3
tell slide3
set object text of default title item to "Investment Performance"
set object text of default body item to "• Growth Portfolio: +3.2% (Benchmark +2.8%)
• Balanced Portfolio: +2.1% (Benchmark +1.9%)
• Income Portfolio: +0.9% (Benchmark +0.7%)
• Average Alpha: +0.3%"
end tell
-- Add Next Steps slide
set slide4 to make new slide with properties {base slide:master slide "Title & Bullets"}
delay 0.3
tell slide4
set object text of default title item to "Q2 Priorities"
set object text of default body item to "• Complete endowment fund implementation
• Expand alternative investment offerings
• Launch client education seminar series
• Target: $25M total new AUM"
end tell
delay 0.5 -- Wait before saving
-- Save the presentation
set savePath to POSIX file "~/Desktop/Q1_Review.key"
save in savePath
end tell
return "Presentation created with 4 slides"
end tell
EOF
关于此示例的关键点:
osascript 命令activate 后 delay 1,让 Keynote 完全启动delay 0.5make new slide 后 delay 0.3delay 0.5当 Keynote 操作失败时,常见问题有:
macos_show(app: "keynote"),然后在运行创建脚本前等待 1-2 秒。/Users/username/Desktop/)delay 语句,尤其是在 make new slide 之后如果脚本超时或崩溃:
delay 1 代替 delay 0.3)重要:在完成创建和保存演示文稿后,务必关闭 Keynote。
如果您有 macos_close 工具可用(视觉演示模式),请使用:
macos_close(target: "keynote", delay_ms: 500)
或者,使用 AppleScript:
osascript -e 'tell application "Keynote" to quit'
这可以保持用户桌面整洁,并展示完整的工作流程。
~/Desktop/ 或用户首选位置Q1_2026_Review.key 和 Q1_2026_Review.pdf)每周安装次数
–
代码仓库
GitHub 星标数
345
首次出现时间
–
安全审计
This skill guides you on how to create and manipulate Keynote presentations on macOS using AppleScript.
Create a Keynote presentation when the user asks to:
macos_show(app: "keynote") if visual mode is enabledALWAYS use a SINGLE AppleScript to create the entire presentation. Do NOT run multiple separate scripts.
Why this matters:
osascript invocation may restart Keynote's scripting bridgeBad approach (causes crashes):
# Script 1: Create document
osascript -e 'tell application "Keynote" to make new document'
# Script 2: Add slide 1
osascript -e 'tell application "Keynote" to tell front document to make new slide'
# Script 3: Set title
osascript -e 'tell application "Keynote" to tell front document to ...'
# This will likely crash!
Good approach (stable):
osascript << 'EOF'
tell application "Keynote"
activate
delay 1 -- Wait for Keynote to fully launch
-- Do ALL operations in ONE script
set newDoc to make new document with properties {document theme:theme "White"}
delay 0.5 -- Brief pause after creating document
tell newDoc
-- All slides and content in one block
...
end tell
end tell
EOF
Required delays:
activate: delay 1 (let app fully launch)make new document: delay 0.5delay 0.3 (optional but recommended for many slides)osascript << 'EOF'
tell application "Keynote"
activate
set newDoc to make new document with properties {document theme:theme "White"}
return name of newDoc
end tell
EOF
Available themes : "White", "Black", "Gradient", "Classic", "Modern Type", "Showcase", "Photo Essay", "Bold", "Industrial", "Blueprint"
osascript << 'EOF'
tell application "Keynote"
tell front document
-- Add slide with specific layout
set newSlide to make new slide with properties {base slide:master slide "Title - Center"}
end tell
end tell
EOF
Common master slides (layouts) :
"Title - Center" - Title and subtitle centered"Title - Top" - Title at top with content area"Title & Subtitle" - Classic title slide"Title & Bullets" - Title with bullet points"Title, Bullets & Photo" - Title, bullets, and image"Bullets" - Full slide bullet points"Photo" - Full slide image"Photo - Horizontal" - Landscape photo layout"Quote" - Quote layoutosascript << 'EOF'
tell application "Keynote"
tell front document
tell current slide
-- Set title
set object text of default title item to "Your Title Here"
-- Set body text (for slides with body placeholder)
set object text of default body item to "• Point 1
• Point 2
• Point 3"
end tell
end tell
end tell
EOF
osascript << 'EOF'
tell application "Keynote"
tell front document
tell current slide
set newText to make new text item with properties {object text:"Custom text here"}
set position of newText to {100, 200}
set width of newText to 400
set height of newText to 100
end tell
end tell
end tell
EOF
osascript << 'EOF'
tell application "Keynote"
tell front document
tell current slide
set imgFile to POSIX file "/path/to/image.jpg"
set newImage to make new image with properties {file:imgFile}
set position of newImage to {300, 200}
set width of newImage to 400
end tell
end tell
end tell
EOF
osascript << 'EOF'
tell application "Keynote"
tell front document
set current slide to slide 3
end tell
end tell
EOF
osascript -e 'tell application "Keynote" to count slides of front document'
osascript << 'EOF'
tell application "Keynote"
tell front document
set exportPath to POSIX file "/Users/username/Desktop/presentation.pdf"
export to exportPath as PDF
end tell
end tell
EOF
osascript << 'EOF'
tell application "Keynote"
tell front document
set savePath to POSIX file "/Users/username/Desktop/my_presentation.key"
save in savePath
end tell
end tell
EOF
This is the recommended pattern - ALL operations in ONE script with proper delays:
osascript << 'EOF'
tell application "Keynote"
activate
delay 1 -- IMPORTANT: Wait for Keynote to fully launch
-- Create new document
set newDoc to make new document with properties {document theme:theme "White"}
delay 0.5 -- Wait for document to initialize
tell newDoc
-- First slide is created automatically, set it as title slide
tell slide 1
set base slide to master slide "Title - Center"
set object text of default title item to "Q1 2026 Business Review"
set object text of default body item to "Financial Services Division"
end tell
delay 0.3
-- Add Overview slide
set slide2 to make new slide with properties {base slide:master slide "Title & Bullets"}
delay 0.3
tell slide2
set object text of default title item to "Executive Summary"
set object text of default body item to "• Revenue increased 15% YoY
• New client acquisition: $15M AUM
• Client satisfaction: 4.8/5.0
• All portfolios outperforming benchmarks"
end tell
-- Add Performance slide
set slide3 to make new slide with properties {base slide:master slide "Title & Bullets"}
delay 0.3
tell slide3
set object text of default title item to "Investment Performance"
set object text of default body item to "• Growth Portfolio: +3.2% (Benchmark +2.8%)
• Balanced Portfolio: +2.1% (Benchmark +1.9%)
• Income Portfolio: +0.9% (Benchmark +0.7%)
• Average Alpha: +0.3%"
end tell
-- Add Next Steps slide
set slide4 to make new slide with properties {base slide:master slide "Title & Bullets"}
delay 0.3
tell slide4
set object text of default title item to "Q2 Priorities"
set object text of default body item to "• Complete endowment fund implementation
• Expand alternative investment offerings
• Launch client education seminar series
• Target: $25M total new AUM"
end tell
delay 0.5 -- Wait before saving
-- Save the presentation
set savePath to POSIX file "~/Desktop/Q1_Review.key"
save in savePath
end tell
return "Presentation created with 4 slides"
end tell
EOF
Key points about this example:
osascript command containing everythingdelay 1 after activate to let Keynote fully launchdelay 0.5 after creating documentdelay 0.3 after each make new slidedelay 0.5 before save operationWhen Keynote operations fail, common issues are:
macos_show(app: "keynote") first, then wait 1-2 seconds before running the creation script./Users/username/Desktop/)delay statements, especially after make new slideIf the script times out or crashes:
delay 1 instead of delay 0.3)IMPORTANT : Always close Keynote after you finish creating and saving the presentation.
If you have macos_close tool available (Visual Demo Mode), use:
macos_close(target: "keynote", delay_ms: 500)
Alternatively, use AppleScript:
osascript -e 'tell application "Keynote" to quit'
This keeps the user's desktop clean and shows a complete workflow.
~/Desktop/ or user's preferred locationQ1_2026_Review.key and Q1_2026_Review.pdf)Weekly Installs
–
Repository
GitHub Stars
345
First Seen
–
Security Audits
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
31,600 周安装
template-skill 模板技能 | Anthropic 官方技能模板 | 高效开发 AI 助手技能
17,700 周安装
Slack GIF 创建工具 - 优化表情符号和消息动画制作指南与Python代码库
17,900 周安装
网站架构规划指南:SEO优化与用户体验设计,打造高效网站结构
18,800 周安装
Expo网络请求与数据获取指南:React Query、缓存策略、API调试
19,300 周安装
Anthropic内部沟通技能:高效撰写3P更新、公司通讯、FAQ回复等内部文档
19,100 周安装
SEO/GEO 优化技能 - 全面优化网站,提升传统与 AI 搜索引擎可见性
20,200 周安装
"Blank"