2011-05-02 94 views
1

當我看到MAC中的文件夾或文件的信息時,「Server」的等效applescript是什麼?如何從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 
+0

從什麼平臺是「服務器」,究竟是什麼呢? – 2011-05-02 13:47:13

+0

@Philip「服務器」是當我們在mac中打開文件夾/文件的信息時顯示的信息。 – Samrat 2011-05-17 10:25:20

回答

1

的更多細節將是有益的,但如果你試圖得到一個安裝服務器的體積而不是本地捲上的文件夾上的信息,有沒有區別儘可能的AppleScript而言,至少一旦它被安裝。獲取它可能是另一個問題。

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

我試圖獲取已安裝的服務器捲上存在的文件夾的信息。我能夠檢索除服務器詳細信息之外的所有詳細信息這可能有助於檢索掛載IP的位置。到目前爲止,我的問題是如何實現檢索細節。 – Samrat 2011-05-03 04:37:02

+0

這方面有沒有進展?我試圖得到相同的信息。我有掛載的服務器的本地名稱,但我需要實際的服務器位置。 – 2011-12-15 20:06:55

相關問題