Expand description
Shareable content types - displays, windows, and applications
This module provides access to the system’s displays, windows, and running
applications that can be captured by ScreenCaptureKit.
§Main Types
SCShareableContent- Container for all available content (displays, windows, apps)SCDisplay- A physical or virtual display that can be capturedSCWindow- A window that can be capturedSCRunningApplication- A running application whose windows can be captured
§Workflow
- Call
SCShareableContent::get()to retrieve available content - Select displays/windows/apps to capture
- Create an
SCContentFilterfrom the selection
§Examples
§List All Content
use screencapturekit::shareable_content::SCShareableContent;
// Get all shareable content
let content = SCShareableContent::get()?;
// List displays
for display in content.displays() {
println!("Display {}: {}x{}",
display.display_id(),
display.width(),
display.height()
);
}
// List windows
for window in content.windows() {
if let Some(title) = window.title() {
println!("Window: {}", title);
}
}
// List applications
for app in content.applications() {
println!("App: {} ({})", app.application_name(), app.bundle_identifier());
}§Filter On-Screen Windows Only
use screencapturekit::shareable_content::SCShareableContent;
let content = SCShareableContent::create()
.with_on_screen_windows_only(true)
.with_exclude_desktop_windows(true)
.get()?;
println!("Found {} on-screen windows", content.windows().len());Re-exports§
pub use display::SCDisplay;pub use running_application::SCRunningApplication;pub use window::SCWindow;
Modules§
Structs§
- SCShareable
Content - SCShareable
Content Info - Information about shareable content from a filter (macOS 14.0+)
- SCShareable
Content Options