UNIX ZIP(1L)不包括顶级应用程序目录

时间:2014-05-16 20:16:40

标签: zip applescript

我做了,更好,我一起翻找了一个产生加密zip文件的AppleScript。它适用于除应用程序外。如果我扩展Archiv它不再是一个应用程序。如何压缩有效的应用程序?

  tell application "Finder"
    set theItem to ((choose file) 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")
    display dialog "Enter password" default answer "" buttons {"OK"} default button 1
    set thePassword to (text returned of result)
end tell
set cmd to "zip -P " & thePassword & " -rj " & zipFile & " " & itemPath & " -x *.DS_Store"
do shell script cmd 

1 个答案:

答案 0 :(得分:0)

检查-y选项是否有zip。它可能是你需要的。

来自iPhone: Compressing .app files in command line (Mac OS X) removes CodeSigning