苹果笔记本 mac os
先看看废纸篓里的文件。一个文件时,有“放回原处”的菜单的,如果是删除的两个文件里的文件时,没有放回原处的菜单了。而“我的所有文件”是每个文件夹的文件都会有的。所以除非人力点击,一个一个的还原。
所以我们要批量实现还原文件,就借助 苹果电脑提供的脚本编辑器程序。第一步,先找到脚本编辑器。打开下面菜单中的第三个图标 launchpad,搜索 automator。就是图片上的小机器人。
打开automator ,找到里面的“服务”。在左边菜单中找到“运行AppleScript” 双击。
在运行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
如果提示一下错误。请将脚本代码中的select the first item of window 'Trash'替换为select the first item of window '废纸篓'
如果运行一段时间后脚本运行错误,提示以下错误时,需要将废纸篓中的当前文件手动恢复活着删除。