多语言展示
当前在线:285今日阅读:60今日分享:41

mac os误删除文件到废纸篓,批量恢复的解决办法

苹果笔记本电脑,不小心把“我的所有文件”里的文件给全删除了,移到废纸篓,伤心啊,去废纸篓里看文件还在,好吧,开始恢复。发现没有批量恢复,只能一个一个的恢复,这操作系统太不人性了,2300多个文件啊,我得恢复到猴年马月啊。mac os只能批量恢复同文件夹下的,没有办法批量恢复不同的文件夹下的文件。下面分享一种学来的批量恢复方式。
工具/原料

苹果笔记本 mac os

方法/步骤
1

先看看废纸篓里的文件。一个文件时,有“放回原处”的菜单的,如果是删除的两个文件里的文件时,没有放回原处的菜单了。而“我的所有文件”是每个文件夹的文件都会有的。所以除非人力点击,一个一个的还原。

2

所以我们要批量实现还原文件,就借助 苹果电脑提供的脚本编辑器程序。第一步,先找到脚本编辑器。打开下面菜单中的第三个图标 launchpad,搜索 automator。就是图片上的小机器人。

3

打开automator ,找到里面的“服务”。在左边菜单中找到“运行AppleScript” 双击。

4

在运行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

6

如果提示一下错误。请将脚本代码中的select the first item of window 'Trash'替换为select the first item of window '废纸篓'

7

如果运行一段时间后脚本运行错误,提示以下错误时,需要将废纸篓中的当前文件手动恢复活着删除。

推荐信息