【问题标题】:Delete PDF files only from folder using Applescript on MAC在 MAC 上使用 Applescript 仅从文件夹中删除 PDF 文件
【发布时间】:2015-07-04 04:44:06
【问题描述】:

我只需要从网络驱动器上的文件夹中删除 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

我得到的错误:

error "Can't get every file of \"Macintosh 高清:用户:凯瑟琳:桌面:ABC123_JOB:\"."每个文件中的数字 -1728 "Macintosh HD:Users:Kathlene:Desktop:ABC123_JOB"

【问题讨论】:

    标签: pdf applescript delete-file


    【解决方案1】:

    试试:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-02-17
      • 2020-04-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-10
      相关资源
      最近更新 更多