我有一个 AppleScript 可以逐行读取 URL 并在 Safari 中打开它们。这个:
set thePath to (path to desktop as Unicode text) & "sites.txt"
set theFile to (open for access file thePath)
set theContent to (read theFile)
close access theFile
set theURLs to every paragraph of theContent
tell application "Safari"
repeat with theURL in theURLs
make new document
set URL of front document to theURL
delay 1
repeat until ((do JavaScript "document.readyState" in front document) is "complete")
delay 30
end repeat
close front document
end repeat
end tell
在此示例中,我使用这些 URL - 它们与我的用例非常相似,我无法分享。
http://www.omdbapi.com/?t=True%20Grit&y=1969
http://www.omdbapi.com/?t=阿凡达&y=2009
这个 AppleScript 对我来说很好用,但我无法将内容写回桌面上的 txt 文件,按请求请求。
有人可以帮忙吗?