0

私は次のことを行うプログラムを書こうとしています...

  • 一連の URL のみを含む textedit からテキスト行を読み取ります (それぞれ別の行にあります)。
  • Web ブラウザの現在のページでその URL に移動します。
  • 読み込まれたページの同じ場所を 2 回クリックします。
  • 「Enter」ボタンを押す
  • 最初のステップから繰り返します

私は applescript の初心者ですが、このプロジェクトを完了するために必要なことは何でも学ぶことができます。私が書こうとしているコードの例を誰かに見せてもらえますか?

4

1 に答える 1

0
set urls to "http://stackoverflow.com/questions/18069198
http://stackoverflow.com"
--set urls to read "/tmp/input.txt" as «class utf8»

repeat with u in paragraphs of urls
    tell application "Safari"
        activate
        open location u
        delay 1
        tell document 1
            repeat while do JavaScript "document.readyState" is not "complete"
                delay 0.1
            end repeat
            do JavaScript "document.querySelectorAll('#hlogo a')[0].click()"
        end tell
    end tell
    tell application "System Events" to keystroke return
end repeat
于 2013-08-06T05:20:06.637 に答える