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

时间:2011-05-02 10:57:36

标签: macos applescript

当我看到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

1 个答案:

答案 0 :(得分:1)

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

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