Using Applescript to zip and unzip a folder

2019-08-28 15:18发布

I have never used applescript before and I'm trying to find out how to zip a folder on the desktop, that's all and it's giving me a hard time

1条回答
Viruses.
2楼-- · 2019-08-28 15:56

If you're happy to use Applescript to just invoke sh, you can use

do shell script "zip /Users/you/Desktop/out.zip /Users/you/Desktop/in.file"
do shell script "unzip -f /Users/you/out.zip"

(The -f option is "freshen", which will stop unzip from asking if you want to overwrite files. To always overwrite, use -o.)

查看更多
登录 后发表回答