sim*_*n.d 41 macos applescript finder objective-c
我正在尝试以编程方式从Xcode项目启动OSX Finder窗口.我需要窗口打开到特定文件夹,并自动选择该文件夹中的特定文件.
有没有人知道如何在目标c,applescript或Finder命令行参数中执行此操作?
谢谢!
Wev*_*vah 85
Objective-C版本:
NSArray *fileURLs = [NSArray arrayWithObjects:fileURL1, /* ... */ nil];
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:fileURLs];
Run Code Online (Sandbox Code Playgroud)
Mat*_*ure 17
$ open -R <path-to-reveal>
Run Code Online (Sandbox Code Playgroud)
小智 7
另一个AppleScript风格 - Finder的揭示命令将打开包含文件夹的窗口并选择项目.如果有多个包含文件夹,将打开多个Finder窗口.
tell application "Finder"
to reveal {someAlias, "path/to/POSIXfile" as POSIX file, etc}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9437 次 |
| 最近记录: |