如何从 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
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
其他详细信息会很有帮助,但如果您尝试获取已安装的服务器卷而不是本地卷上存在的文件夹的信息,则就 AppleScript 而言,没有区别,至少在安装后是这样。安装它可能是另一个问题。
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.