如何从 applescript 检索文件夹/文件的服务器详细信息

发布于 2024-11-04 11:53:09 字数 1331 浏览 2 评论 0原文

当我在 MAC 中看到文件夹或文件的信息时,“服务器”的等效 applescript 是什么?

on run
    set selectedItem to (choose file with prompt "Select a file to read:" of type {"TEXT"})


    tell application "Finder"
        set selectedItem to (item 1 of (get selection))
        set infoList to {}
        copy ("Displayed Name: " & displayed name of selectedItem) to end of infoList
        copy ("Kind: " & kind of selectedItem) to end of infoList
        copy ("Size: " & size of selectedItem & " (" & physical size of selectedItem & ")") to end of infoList
        copy ("Created: " & creation date of selectedItem) to end of infoList
        copy ("Modified: " & modification date of selectedItem) to end of infoList
        copy ("Name & Extension: " & name of selectedItem) to end of infoList
        copy ("Locked: " & locked of selectedItem) to end of infoList
        copy ("Comments: " & comment of selectedItem) to end of infoList
        copy ("Owner: " & owner of selectedItem) to end of infoList
    end tell
    set {od, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
    set infoAsString to infoList as string
    set AppleScript's text item delimiters to od
    set the clipboard to infoAsString
    return infoAsString
end run

What is the equivalent applescript for "Server" when i see info of folder or file in MAC?

on run
    set selectedItem to (choose file with prompt "Select a file to read:" of type {"TEXT"})


    tell application "Finder"
        set selectedItem to (item 1 of (get selection))
        set infoList to {}
        copy ("Displayed Name: " & displayed name of selectedItem) to end of infoList
        copy ("Kind: " & kind of selectedItem) to end of infoList
        copy ("Size: " & size of selectedItem & " (" & physical size of selectedItem & ")") to end of infoList
        copy ("Created: " & creation date of selectedItem) to end of infoList
        copy ("Modified: " & modification date of selectedItem) to end of infoList
        copy ("Name & Extension: " & name of selectedItem) to end of infoList
        copy ("Locked: " & locked of selectedItem) to end of infoList
        copy ("Comments: " & comment of selectedItem) to end of infoList
        copy ("Owner: " & owner of selectedItem) to end of infoList
    end tell
    set {od, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
    set infoAsString to infoList as string
    set AppleScript's text item delimiters to od
    set the clipboard to infoAsString
    return infoAsString
end run

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鹿! 2024-11-11 11:53:10

其他详细信息会很有帮助,但如果您尝试获取已安装的服务器卷而不是本地卷上存在的文件夹的信息,则就 AppleScript 而言,没有区别,至少在安装后是这样。安装它可能是另一个问题。

tell application "Finder" to get
    properties of folder "Macintosh HD:Volumes:Mounted Server Volume"
end tell

Additional details would be helpful, but if you're attempting to get info on a folder that exists on a mounted server volume instead of a local volume, there's no difference as far as AppleScript is concerned, at least once it's mounted. Getting it mounted might be another issue.

tell application "Finder" to get
    properties of folder "Macintosh HD:Volumes:Mounted Server Volume"
end tell
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文