pull/2019/head
amrbashir 9 months ago
parent 67c8f42936
commit 73959f5d9a
No known key found for this signature in database
GPG Key ID: BBD7A47A2003FF33

2
Cargo.lock generated

@ -6585,6 +6585,8 @@ name = "tauri-plugin-opener"
version = "2.0.0"
dependencies = [
"dunce",
"objc2-app-kit",
"objc2-foundation",
"open",
"regex",
"schemars",

@ -54,3 +54,11 @@ features = [
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"netbsd\", target_os = \"openbsd\"))".dependencies]
zbus = { workspace = true }
[target."cfg(target_os = \"macos\")".dependencies.objc2-app-kit]
version = "0.2"
features = ["NSWorkspace"]
[target."cfg(target_os = \"macos\")".dependencies.objc2-foundation]
version = "0.2"
features = ["NSURL", "NSArray", "NSString"]

@ -167,6 +167,17 @@ mod imp {
#[cfg(target_os = "macos")]
mod imp {
use super::*;
use objc2_app_kit::NSWorkspace;
use objc2_foundation::{NSArray, NSString, NSURL};
pub fn reveal_item_in_dir(path: &Path) -> crate::Result<()> {
unsafe {
let path = path.to_string_lossy();
let path = NSString::from_str(&path);
let urls = vec![NSURL::fileURLWithPath(&path)];
let urls = NSArray::from_vec(urls);
pub fn reveal_item_in_dir(path: &Path) -> crate::Result<()> {}
let workspace = NSWorkspace::new();
workspace.activateFileViewerSelectingURLs(&urls);
}
}
}

Loading…
Cancel
Save