因为您在repeat with anItem in input
循环中,所以它会为第一项完成所有工作,并return
退出循环,实际上是整个 Automator 操作。我想你从来没有beep
从你的剧本中听到过;-)
另一方面,我想知道为什么您希望 BBEdit 为您完成 cUrl 和排序工作。所有被调用的处理程序都不属于 BBEdit ...
我认为您的处理程序应如下所示:
on run {input, parameters}
-- define a few parameters
set astid to AppleScript's text item delimiters
set startHere to "<tbody>"
set stopHere to "</tbody>"
-- define a list to store all found content
set allFoundContent to {}
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
-- put the found content at the end of the list
set end of allFoundContent to text item 1 of blurb1
set AppleScript's text item delimiters to astid
end repeat
-- from here you have three possibilities:
-- 1. return the list to next Automator action (uncomment the next line):
-- return allFoundContent
-- 2. concatenate the list with a delimiter you like (here return & "------" & return)
-- and give it to your preferred text editor from this point (uncomment the next lines):
-- set AppleScript's text item delimiters to return & "------" & return
-- tell application "TextEdit"
-- make new document with properties {text: allFoundContent as text}
-- end tell
-- set AppleScript's text item delimiters to astid
-- 3. concatenate the list with a delimiter you like (here return & "------" & return)
-- and give it to the next workflow step, maybe a BBEdit action waiting for a string? (uncomment the next lines):
-- set AppleScript's text item delimiters to return & "------" & return
-- set returnString to allFoundContent as text
-- set AppleScript's text item delimiters to astid
-- return returnString
-- Next decision (for choice 1 or 2):
-- What do you want to give to next Automator action?
-- you can pass your input (the given URLs) (uncomment next line):
-- return input
-- or your result list (uncomment next line):
-- return allFoundContent
end run
问候,迈克尔/汉堡