Skill v1.0.1
currentAutomated scan96/1002 files
version: "1.0.1" name: Keynote Creator description: Guide for creating and editing Keynote presentations using AppleScript via bash
Keynote Creator Skill
This skill guides you on how to create and manipulate Keynote presentations on macOS using AppleScript.
When to Use
Create a Keynote presentation when the user asks to:
- Create a presentation/slideshow/PPT
- Generate slides from documents, reports, or data
- Make a pitch deck, proposal, or summary presentation
- Convert content into visual presentation format
Workflow
- Open Keynote (for visual demo): Use
macos_show(app: "keynote")if visual mode is enabled - Create presentation: Use bash with AppleScript
- Add slides: Use AppleScript to add and configure slides
- Set content: Add titles, body text, and images
- Export: Save as .key or export to PDF
CRITICAL: Stability Best Practices
ALWAYS use a SINGLE AppleScript to create the entire presentation. Do NOT run multiple separate scripts.
Why this matters:
- Each
osascriptinvocation may restart Keynote's scripting bridge - Multiple rapid scripts cause Keynote to crash or become unresponsive
- A single comprehensive script is much more stable
Bad approach (causes crashes):
# Script 1: Create documentosascript -e 'tell application "Keynote" to make new document'# Script 2: Add slide 1osascript -e 'tell application "Keynote" to tell front document to make new slide'# Script 3: Set titleosascript -e 'tell application "Keynote" to tell front document to ...'# This will likely crash!
Good approach (stable):
osascript << 'EOF'tell application "Keynote"activatedelay 1 -- Wait for Keynote to fully launch-- Do ALL operations in ONE scriptset newDoc to make new document with properties {document theme:theme "White"}delay 0.5 -- Brief pause after creating documenttell newDoc-- All slides and content in one block...end tellend tellEOF
Required delays:
- After
activate:delay 1(let app fully launch) - After
make new document:delay 0.5 - After adding each slide:
delay 0.3(optional but recommended for many slides)
AppleScript Patterns
Create New Presentation
osascript << 'EOF'tell application "Keynote"activateset newDoc to make new document with properties {document theme:theme "White"}return name of newDocend tellEOF
Available themes: "White", "Black", "Gradient", "Classic", "Modern Type", "Showcase", "Photo Essay", "Bold", "Industrial", "Blueprint"
Add a Slide
osascript << 'EOF'tell application "Keynote"tell front document-- Add slide with specific layoutset newSlide to make new slide with properties {base slide:master slide "Title - Center"}end tellend tellEOF
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 layout"Blank"- Empty slide
Set Slide Title and Body
osascript << 'EOF'tell application "Keynote"tell front documenttell current slide-- Set titleset 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 tellend tellend tellEOF
Add Text Box with Custom Position
osascript << 'EOF'tell application "Keynote"tell front documenttell current slideset 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 400set height of newText to 100end tellend tellend tellEOF
Add Image to Slide
osascript << 'EOF'tell application "Keynote"tell front documenttell current slideset 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 400end tellend tellend tellEOF
Navigate to Specific Slide
osascript << 'EOF'tell application "Keynote"tell front documentset current slide to slide 3end tellend tellEOF
Get Slide Count
osascript -e 'tell application "Keynote" to count slides of front document'
Export to PDF
osascript << 'EOF'tell application "Keynote"tell front documentset exportPath to POSIX file "/Users/username/Desktop/presentation.pdf"export to exportPath as PDFend tellend tellEOF
Save Presentation
osascript << 'EOF'tell application "Keynote"tell front documentset savePath to POSIX file "/Users/username/Desktop/my_presentation.key"save in savePathend tellend tellEOF
Complete Example: Multi-Slide Presentation
This is the recommended pattern - ALL operations in ONE script with proper delays:
osascript << 'EOF'tell application "Keynote"activatedelay 1 -- IMPORTANT: Wait for Keynote to fully launch-- Create new documentset newDoc to make new document with properties {document theme:theme "White"}delay 0.5 -- Wait for document to initializetell newDoc-- First slide is created automatically, set it as title slidetell slide 1set 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 telldelay 0.3-- Add Overview slideset slide2 to make new slide with properties {base slide:master slide "Title & Bullets"}delay 0.3tell slide2set 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 slideset slide3 to make new slide with properties {base slide:master slide "Title & Bullets"}delay 0.3tell slide3set 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 slideset slide4 to make new slide with properties {base slide:master slide "Title & Bullets"}delay 0.3tell slide4set 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 telldelay 0.5 -- Wait before saving-- Save the presentationset savePath to POSIX file "~/Desktop/Q1_Review.key"save in savePathend tellreturn "Presentation created with 4 slides"end tellEOF
Key points about this example:
- Single
osascriptcommand containing everything delay 1after activate to let Keynote fully launchdelay 0.5after creating documentdelay 0.3after eachmake new slidedelay 0.5before save operation
Tips for Better Presentations
- Structure: Always start with a title slide, then overview, details, and conclusion
- Bullet Points: Keep to 4-6 points per slide for readability
- Titles: Use clear, action-oriented titles
- Consistency: Use the same master slide for similar content types
- Images: Position images consistently across slides
Error Handling
When Keynote operations fail, common issues are:
- Crashes/Freezes: Almost always caused by running multiple separate scripts. Solution: Combine into ONE script.
- App not running: Use
macos_show(app: "keynote")first, then wait 1-2 seconds before running the creation script. - Invalid master slide name: Check available layouts with document's master slides
- File path issues: Always use POSIX file syntax and expand ~ to full path (e.g.,
/Users/username/Desktop/) - "Keynote got an error": Add more
delaystatements, especially aftermake new slide
If the script times out or crashes:
- First, check if Keynote is still open - it may have created partial content
- Try adding longer delays (e.g.,
delay 1instead ofdelay 0.3) - For very long presentations (10+ slides), consider splitting into two separate runs
Recommended Workflow for Generating from Reports
- Read the source (reports, documents)
- Plan slide structure (identify key sections)
- Create presentation with appropriate theme
- Add slides iteratively - one at a time with content
- Save and Export - save as .key AND export to PDF
- Close Keynote - always close the app after finishing (see below)
- Send BOTH files to user via messaging platform (.key for editing, PDF for viewing)
Closing Keynote After Creation
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.
File Handling
- Save .key files to
~/Desktop/or user's preferred location - Export PDF to the same location with same base name
- Use descriptive filenames with dates (e.g.,
Q1_2026_Review.keyandQ1_2026_Review.pdf) - IMPORTANT: Always send both .key and .pdf files to the user