AppleScript + JavaScript Tutorial mit Video

Meine Güte ist mir langweilig. AppleScript StepByStep mit Video und Quellcode…

Code zum markieren einmal anklicken Code im Skript-Editor öffnen

tell application “Safari”

activate

open location “http://www.heise.de/newsticker/”

set mysearch to text returned of (display dialog “Meldungen anzeigen die … enthalten:” default answer “”)

tell document 1

set mylinks to do JavaScript

var myoutput = new Array();

for (var i=0;i<document.links.length;i++){

if (document.links[i].text.indexOf(‘” & mysearch & “‘)>-1 && document.links[i].href.indexOf(‘/newsticker/meldung/’)>-1) {

myoutput.push(document.links[i].href)

}

}

myoutput

repeat with mylink in mylinks

my makeNewTab()

do JavaScript “document.location='” & mylink & “‘”

end repeat

end tell

end tell

on makeNewTab()

tell application “Safari” to activate

tell application “System Events”

tell process “Safari”

keystroke “t” using command down

end tell

end tell

delay 0.5

end makeNewTab

One thought on “AppleScript + JavaScript Tutorial mit Video

  1. Tessie Lanthier says:

    Superb tutorial! It saved me a tremendous amount of hair pulling. Seriously, thank you.

Leave a Reply