Mac批量恢复废纸篓文件

错误将大量文件放回了废纸箩,选中单个文件时右键可以“放回原处”,批量选中时就不能放回原处了,终于在网上找到了解决方法,由于系统版本问题,度娘到的内容还是有偏差,操作的时候自己根据系统出了

本人系统:

Mac(OS 10.13.4)

采用Automator(自动操作)恢复

1、打开Automator

2、选择“服务” -> "选取" 进入图二, 点击 运行AppleScript


3、编辑 AppleScript脚本内容:(把里面之前的内容全部删除,把下面的内容全部拷贝到里面)

tell application "Finder"  
    activate  
    set file_count to count of (trash's items)  
    -- log file_count  
    repeat file_count times  
        recoverMyFile() of me  
    end repeat  
end tell  
on recoverMyFile()  
    tell application "System Events"  
        set frontmost of process "Finder" to true  
        tell application "Finder"  
            open trash  
            select the first item of window "Trash"  
        end tell  
        tell process "Finder"  
            key code 51 using command down  
            delay 1 -- Yes, it's stupid, but necessary :(  
        end tell  
    end tell  
end recoverMyFile

4、点击右上角的运行,如果报下面的错误,不着急,请将脚本代码中的

select the first item of window "Trash"

替换为

select the first item of window "废纸篓"

5、重新运行:(工作流程已完成)

到这里,恭喜你已经批量恢复完成了,快去文件中看看吧。 脚本的作用就是执行:选中单个文件->单击右键->"放回原处"。在废纸箩中不断重复操作的过程。


  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

启程Boy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值