Expand description
Apple Notes Exporter Library
A library for exporting Apple Notes folders to the file system via AppleScript.
This library provides functions to list available Apple Notes folders and export them recursively to HTML files. It works by invoking an embedded AppleScript that interacts with the Notes app.
§Requirements
- macOS only - This library relies on AppleScript and the Notes app, which are only available on macOS. Running on other platforms will return an error at runtime.
- Automation permissions for the Notes app must be granted in System Settings
§Quick Start
use apple_notes_exporter_rs::{list_folders, export_folder, export_folder_from_account};
// List all available folders
list_folders().expect("Failed to list folders");
// Export a folder to a directory (searches all accounts)
export_folder("My Notes", "./exports").expect("Failed to export");
// Export from a specific account (useful when folder names are duplicated)
export_folder_from_account("iCloud", "Work", "./exports").expect("Failed to export");§Using a Custom Script
If you need to use a custom AppleScript (e.g., a modified version), use the Exporter struct:
use apple_notes_exporter_rs::Exporter;
let exporter = Exporter::with_script_path("./my_custom_script.applescript")
.expect("Script not found");
exporter.list_folders().expect("Failed to list folders");
exporter.export_folder("My Notes", "./exports").expect("Failed to export");Structs§
- Exporter
- An Apple Notes exporter that can list folders and export notes.
- Extracted
Attachment - Information about an extracted attachment.
- Extraction
Result - Result of extracting attachments from an HTML file.
Enums§
- Export
Error - Errors that can occur during Apple Notes export operations.
Functions§
- export_
folder - Exports a folder recursively to HTML files.
- export_
folder_ from_ account - Exports a folder from a specific account recursively to HTML files.
- extract_
attachments_ from_ directory - Extracts attachments from all HTML files in a directory (recursively).
- extract_
attachments_ from_ html - Extracts base64-encoded images from an HTML file and saves them to an attachments folder.
- list_
folders - Lists all available top-level folders across all Apple Notes accounts.
Type Aliases§
- Result
- Result type alias for export operations.