Applescript排除zip上的文件类型

时间:2016-01-05 09:29:24

标签: macos automation zip applescript finder

我需要调整一个AppleScript,我必须排除几种文件类型。我想我需要像-x“ .fla ”之类的东西,但我似乎无法使语法正常工作。

on run {input, parameters}
    if input is {} then -- no dropped items
        tell application "Finder" to set input to selection as alias list
    end if
    repeat with x in input
        set _path to POSIX path of x
        tell application "Finder"
            if kind of x is "Folder" then tell me to zipFolder(_path)
        end tell
    end repeat
end run

on zipFolder(theFolderPath)

do shell script "tDir=" & (quoted form of theFolderPath) & "; cd \"$tDir\"; aZip=\"../$(basename \"$tDir\").zip\"; if [ -e \"$aZip\" ]; then rm \"$aZip\"; fi;  zip -r \"$aZip\" ./"
end zipFolder

感谢您提供任何帮助

1 个答案:

答案 0 :(得分:0)

在最后一个双引号之前添加exclude选项: ./ -x *.fla"