仅使用MAC上的Applescript从文件夹中删除PDF文件

时间:2013-03-07 21:14:02

标签: pdf applescript delete-file

我只需要从网络驱动器上的文件夹中删除PDF文件。我无法触摸的文件夹中还有其他文件类型。我假设我必须先选择或识别PF文件,然后将它们移到垃圾箱或删除它们。

到目前为止我所拥有的:

tell application "Finder"
    set theFolder to "Macintosh HD:Users:Kathlene:Desktop:ABC123_JOB"
    set destFolder to "Server/JOBS/TRANSFER_TRASH/"
    set thePDFs to every file of theFolder whose name extension is "pdf"
    move thePDFs to destFolder
end tell

我得到的错误是什么:

  

错误“无法获取Macintosh的每个文件”   高清:用户:Kathlene:桌面:ABC123_JOB:\ “”每个文件的编号为-1728   “Macintosh HD:用户:Kathlene:桌面:ABC123_JOB”

1 个答案:

答案 0 :(得分:1)

尝试:

tell application "Finder" to delete (files of folder "Macintosh HD:Users:Kathlene:Desktop:ABC123_JOB" whose name extension is "pdf")