【发布时间】:2011-02-05 20:05:43
【问题描述】:
我有这个applescript,它采用选定的项目并压缩该文件/文件夹并将名称用作压缩名称。我遇到的问题是,当我解压缩 zip 文件时,它具有一个文件夹结构,所有从用户开始的路径。 像这样:
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
【问题讨论】:
标签: zip applescript