【问题标题】:How to retrieve server path of a selected item in finder如何在查找器中检索所选项目的服务器路径
【发布时间】:2009-05-07 12:22:28
【问题描述】:

有没有办法用applescript在finder中检索所选项目的服务器路径名?

我尝试了属性 URL 和 POSIX 路径,但它们只是指向本地文件系统而不是服务器路径,例如:smb://server/folder1/folder2/filename

到目前为止的代码:

tell application "Finder"
    set selectedItem to the selection as alias
    URL of selectedItem --ouput: file://localhost/Volumes/server/folder1/folder2/filename
    POSIX path of selectedItem --output: /Volumes/server/folder1/folder2/filename
end tell

感谢您的帮助

【问题讨论】:

    标签: applescript


    【解决方案1】:

    我认为这与 OS X(以及每个 *nix)中目录的工作方式有关。 AFAIK Mac 上没有 UNC 样式的路径。因此,唯一的解决方法是创建一个可用 Windows 共享的数据库,查找文件卷的名称,然后根据该名称输出一个“file://some/server/path”样式的 URL。

    至少当我遇到同样的问题时我就是这样做的。请注意,smb:// 网址不适用于大多数网络应用。

    thisthis 对此有所了解。

    【讨论】:

      猜你喜欢
      • 2018-11-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-02
      • 1970-01-01
      相关资源
      最近更新 更多