Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Apple Notes Exporter
A library and CLI tool for recursively exporting Apple Notes folders to the file system via AppleScript. This Rust-based tool allows you to export entire folder hierarchies from Apple Notes, creating a mirrored directory structure with each note saved as an HTML file.
Quick Install
Install from crates.io using Cargo:
Or install directly from GitHub:
Features
- Recursive export of Apple Notes folders (including all subfolders and notes)
- List all available folders across all accounts
- Creates a mirrored directory tree structure
- Exports each note as an HTML file
- Breadth-first search (BFS) to find folders at any level
- Support for multiple Apple Notes accounts
- Simple command-line interface with subcommands
- Library API for programmatic access
CLI Installation
Install from crates.io (Recommended)
Install from GitHub
Install directly from the GitHub repository:
Build from Source
The binary will be available at target/release/apple-notes-exporter.
CLI Usage
The tool provides two subcommands: list and export.
List Available Folders
List all top-level folders across all Apple Notes accounts:
Export a Folder
Export a folder recursively to HTML files:
Examples
List all available folders:
Export a folder (searches all accounts):
Export a folder from a specific account (useful when folder names exist in multiple accounts):
Running from Source
If you want to run the tool directly from the source code without installing:
# Clone the repository with submodules
# List folders
# Export a folder
If you already cloned without --recursive, initialize the submodules:
Library Usage
Add the dependency to your Cargo.toml:
[]
= "1.0"
Quick Start
use ;
Using the Exporter Struct
For more control, use the Exporter struct:
use Exporter;
Using a Custom AppleScript
If you need to use a modified AppleScript:
use Exporter;
Error Handling
The library provides a custom ExportError type:
use ;
How It Works
-
Folder Search: The tool uses breadth-first search (BFS) to find the specified folder at any level in your Apple Notes hierarchy (not just top-level folders).
-
Export Process: Once found, it recursively exports that folder and all its subfolders, creating a mirrored directory tree.
-
Output Format: Each note is exported as an HTML file, preserving the folder structure in the output directory.
-
Account Handling: By default, the folder search looks in all accounts. If a folder name exists in multiple accounts, you can specify the account using the
AccountName:FolderNameformat.
Requirements
macOS Only
This tool is macOS-specific as it relies on AppleScript to interact with the Notes app.
Automation Permissions
Important: This tool requires Automation permissions for the Notes app. You'll need to grant these permissions when you first run the tool:
- Go to System Settings > Privacy & Security > Automation
- Find the application that invoked the script (e.g., Terminal, iTerm, or Script Editor)
- Enable permissions for the Notes app
If permissions are not granted, the export will fail.
Project Structure
apple-notes-exporter-rs/
├── src/
│ ├── lib.rs # Library with public API
│ └── main.rs # CLI application
├── vendor/
│ └── apple-notes-exporter/
│ └── scripts/
│ └── export_notes.applescript # AppleScript used for export
├── Cargo.toml
└── README.md
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Acknowledgments
This tool uses the AppleScript from the apple-notes-exporter project, which is included as a git submodule.