我有一个工作流,从 FTP 下载文件到我的电脑,使用传输和自动化。
自动机中的动作看起来像这样:
此操作的信息是正确的,并且远程文件路径的文件已下载到我的计算机。
然而,通过下载(〜 200 个文件)的方式的 1 / 3,自动抛出一个错误:
下载仍在继续,但错误会阻止 automator 执行工作流的其余部分。
所以我的问题是:如何解决此错误,或者至少在显示错误后使工作流继续?

有一种方法可以让Automator在不超时的情况下继续执行工作流。使用AppleScript,如果将下载命令包装在with timeout of 1000
命令中(1000 以秒为单位。使用您认为可以工作的任何数字),则脚本现在将等待最多 1000 秒以完成下载命令,而不是默认的 120 秒。
因此,您可以在工作流中插入Run AppleScript命令,而不是将Automator Transmit Download操作添加到Automator Workflow
例如,假设您想在Transmit.app中的remote browser of the current tab
上下载每个当前选择的文件而不超时,则可以将Run AppleScript命令插入到您的Workflow中,并插入以下 AppleScript 代码。(显然,可以根据需要编辑代码中的属性。)
property downloadLocation : POSIX path of (path to desktop)
property filesToDownload : missing value
tell application "Transmit"
tell its document "Transmit"
set selectedFiles to a reference to selected browser items of ¬
(get remote browser of current tab)
if (count of selectedFiles) > 0 then
set filesToDownload to path of selectedFiles
else
return
end if
repeat with thisFile in filesToDownload
with timeout of 1200 seconds
download remote browser of current tab item at path thisFile to ¬
downloadLocation with resume mode resume
end timeout
end repeat
end tell
end tell

这是来自 Panic 的library:
将 Automator 配置为上载或同步大文件时,Automator 可能会遇到错误:“操作“Synchronize”遇到错误:“操作无法完成。(Cocoa 错误-1)”。我们还看到此错误显示为:-1712,-1753 和-1。-1 是最常见的。
不幸的是,Apple 已经为 macOS 10.14 及更高版本的 Automator 操作设置了 2 分钟超时。我们已经向 Apple 报告了这一点,但目前还没有修复或解决方法。
如果这听起来像你所面临的问题(你没有提到你的操作系统或传输版本),那么也许你可以调整工作流程来处理块中的文件列表。
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(71条)