我有一个Applescript,它可以将所选项目压缩成文件夹,并使用该名称作为压缩包的名称。但问题是,当我解压缩时,它会保留所有路径,从用户(User)一直到上层目录。 就像这样:
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