1

我只需要从网络驱动器上的文件夹中删除 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 HD:Users:Kathlene:Desktop:ABC123_JOB:\" 的每个文件。” “Macintosh HD:Users:Kathlene:Desktop:ABC123_JOB”的每个文件中的编号 -1728

4

1 回答 1

1

尝试:

tell application "Finder" to delete (files of folder "Macintosh HD:Users:Kathlene:Desktop:ABC123_JOB" whose name extension is "pdf")
于 2013-03-07T21:26:04.330 回答