Wie lange braucht mein Mac zum Aufwachen…

7/05/2011
Ich finde es etwas fragwürdig, das per Skript zu messen... aber wie sonst? Es ist aber ein nettes Beispiel, wie man pmset skripten kann.

--07.05.2011 hubionmac.com

--skript that measures the time until wakeup is complete

-- this gives a f*** about your wakeorpoweron settings, they will be deleted!!!


set mystartup to build_pmset_date(1)

set ct to current date

tell application "Finder" to sleep

repeat until 1 = 0

if ct > mystartup then

exit repeat

else

set ct to current date

delay 1

end if

end repeat

set diff to ct - mystartup

display dialog "Waking up took me " & diff & " sec."

--clean wakup-plan

do shell script "pmset repeat cancel" with administrator privileges



on build_pmset_date(plusminutes)

set d to (current date) + (plusminutes * 60)

--make sure that we will end up with at least 1 minute...

if seconds of d > 30 then

set d to d + 60

end if

set thehour to characters -2 through -1 of (("0" & (hours of d as integer)) as text)

set theminutes to characters -2 through -1 of (("0" & (minutes of d as integer)) as text)

--pmset does not care about seconds...

set theseconds to "00"

set seconds of d to 0

set thetime to thehour & ":" & theminutes & ":" & theseconds

--clean wakup-plan

do shell script "pmset repeat cancel" with administrator privileges

--set the plan

do shell script "pmset repeat wakeorpoweron MTWRFSU \"" & thetime & "\"" with administrator privileges

return d

end build_pmset_date

No Comments

Stop iTunes after x Minutes.app

13/12/2009
itunes stop iconIch schlafe gerne mit Musik ein und dafür habe ich mir mal diese Anwendung geschrieben. Ist ein simples Skript, das wahrscheinlich auch Einzug in die iTunes-Skript-Sammlung erhalten wird. Dies aber schon vorab.
Alles was man machen muss, ist das Skript starten, angeben, wie lange die Musik noch laufen muss... Nun, es erklärt sich wirklich von alleine =)
DOWNLOAD
iTunes Auto Stop v.1.0
(420 hits)
Ach so, und Leopard-kompatibel ist es sogar auch schon ;-)
1 Comment