使用 Applescript 压缩和解压缩文件夹 [英] Using Applescript to zip and unzip a folder

查看:48
本文介绍了使用 Applescript 压缩和解压缩文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前从未使用过applescript,我正在尝试找出如何在桌面上压缩文件夹,仅此而已,这让我很痛苦

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

推荐答案

如果你乐于使用 Applescript 来调用 sh,你可以使用

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"

(-f 选项是freshen",这将阻止 unzip 询问您是否要覆盖文件.要始终覆盖,请使用 -o.)

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

这篇关于使用 Applescript 压缩和解压缩文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆