【发布时间】:2011-09-25 08:10:14
【问题描述】:
我正在开发 Automator 工作流程,我正在将 URL 列表传递给“运行 Applescript”,并且我需要获取每个页面上的内容,连接并将其传递给 BBedit(或任何其他文本编辑器)。
on run {input, parameters}
tell application "BBEdit"
activate
set astid to AppleScript's text item delimiters
set startHere to "<tbody>"
set stopHere to "</tbody>"
repeat with anItem in input
set blurb0 to (do shell script "curl " & anItem)
set AppleScript's text item delimiters to startHere
set blurb1 to text item 2 of blurb0
set AppleScript's text item delimiters to stopHere
set blurb2 to text item 1 of blurb1
set AppleScript's text item delimiters to astid
return blurb2
beep
end repeat
end tell
end run
当前代码仅正确地仅从第一个 URL 获取内容。有人可以解决这个问题吗?
【问题讨论】:
标签: applescript automator osx-snow-leopard