Safe Rust bindings for Apple’s ScriptingBridge.framework on macOS, extended
with Swift-bridged NSAppleEventDescriptor and NSAppleScript helpers for
fully dynamic automation flows.
0.2.0 covers six logical areas:
SBApplicationSBObjectSBElementArraySBApplicationDelegateNSAppleEventDescriptorNSAppleScript
See COVERAGE.md for the API-by-API matrix.
[dependencies]
scriptingbridge-rs = "0.2"use scriptingbridge::Application;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let finder = Application::with_bundle_identifier("com.apple.finder")?;
println!("Finder running: {}", finder.is_running());
Ok(())
}SBApplicationconstructors by bundle identifier, URL, or process identifier, pluslaunch_flags,send_mode,timeout, delegate attachment, andclass_for_scripting_class.ScriptObject/ElementArraywrappers for property lookups, array queries, and low-level Apple event sends.AppleEventDescriptorbuilders for lists, records, addresses, rawAEDescround-trips, and Apple event mutation / sending.AppleScripthelpers for inline source, file-backed scripts, compilation, and execution.
tell()remains the convenience helper for zero- or one-argument string selectors / key paths.SBObject::send_eventandApplication::send_eventexpose the dynamic Apple event path directly when you need lower-level control.AppleEventDescriptorre-exports the standard Apple event send-option bitflags and theNSAppleScripterror dictionary keys.
cargo run --example 01_finder_handle
cargo run --example 02_sbobject_properties
cargo run --example 03_sbelementarray_disks
cargo run --example 04_sbapplication_delegate
cargo run --example 05_nsappleeventdescriptor_roundtrip
cargo run --example 06_nsapplescript_runLicensed under either of:
- MIT license (LICENSE-MIT)
- Apache License, Version 2.0 (LICENSE-APACHE)