Crate apple_notes_exporter_rs

Crate apple_notes_exporter_rs 

Source
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.
ExtractedAttachment
Information about an extracted attachment.
ExtractionResult
Result of extracting attachments from an HTML file.

Enums§

ExportError
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.