AppleScript Traffic

N

nsys

Registriert
Thread Starter
Dabei seit
28.12.2010
Beiträge
4
Reaktionspunkte
0
Hi,
ich würde gerne mit AppleScript prüfen, wie viel Traffic gerade raus geht.
Konkrete Anwendung: Es soll ein Befehl ausgeführt werden, wenn der Upstream einen bestimmten Wert unterschreitet. Ich möchte das verwenden, um mir von meinem Mac einen Tweet schicken zu lassen, wenn es Uploadprobleme gibt.

Danke für die Hilfe,
Nils
 
Bandwidth Monitor NG

damit on idle funktioniert, als Programm mit Option nicht automatisch beenden speichern

Code:
on idle
	set csv to do shell script "bwm-ng -I en0 -o csv -c 1"
	--http://sourceforge.net/projects/bwmng/
	
	set AppleScript's text item delimiters to {";"}
	set Tx to text item 3 of csv
	set Tx to round ((round Tx) / 1024)
	if Tx < 100 then --100 KB/s
		tell application "Mail"
			set neue_email to make new outgoing message with properties {subject:"Tx " & Tx & " KB/s", content:"", visible:false}
			tell neue_email
				make new to recipient at end of to recipients with properties {address:"name@email.de"}
				send
			end tell
		end tell
	end if
	return 60 --60 Sekunden
end idle
 
Hi,
Danke für die Antwort! Gibt es auch eine Lösung, ohne Kommandozeilen-Installation?

Nils
 
Zurück
Oben Unten