3
我有这个applescript需要选择的项目和拉链文件/文件夹,并使用该名称作为zip名称。我遇到的问题是,当我解压缩zip文件时,它使得文件夹结构中的所有用户的路径都起作用。 像这样:zip文件夹使用applescript
Users:
username:
folder:
folder:
我只是想它是:
folder:
下面是代码:
tell application "Finder"
set theItem to selection as alias
set itemPath to quoted form of POSIX path of theItem
set fileName to name of theItem
set theFolder to POSIX path of (container of theItem as alias)
set zipFile to quoted form of (theFolder & fileName & ".zip")
do shell script "zip -r " & zipFile & " " & itemPath
end tell
如果您使用-j,当有两个具有相同名称的文件时,您将看到一个错误。 – Peter