【发布时间】:2016-08-02 19:40:11
【问题描述】:
我有一个正常工作的进度条码,但是当我将它与一些任务混合使用时,比如在这里复制文件,它给了我错误并且不会增加,它在第一次复制后停止,知道问题出在哪里吗?
代码如下:
tell application "Finder"
set selected_items to selection
set fileCount to length of selected_items
end tell
set progress total steps to fileCount
set progress completed steps to 0
set progress description to "Processing Images..."
set progress additional description to "Preparing to process."
set a to 1
tell application "Finder"
set theFolder to POSIX file "/Users/graphics/Desktop/1"
repeat with x in selected_items
set progress additional description to "Processing image " & a & " of " & fileCount
duplicate x to theFolder
set progress completed steps to a + 1
set a to a + 1
end repeat
end tell
【问题讨论】:
-
1.您是否将其保存为小程序? 2.也许Finder的选择只包含你点击后的脚本?在重复之前创建
display dialog x as string以确保 3. 告诉我们更多关于您遇到的错误。 -
我将它保存为应用程序,它只是在第一个之后停止,这是你可以运行它并查看错误的整个脚本
-
如何启动脚本?您是否尝试过我回答的第 2 点?
-
我从脚本编辑器运行脚本,并且我确定查找器选择包含文件而不是脚本,您是否在您的机器上尝试过此代码?
-
好的,请双击启动应用程序!但在您的第一个
tell application Finder之后添加activate之前
标签: macos applescript