Sleep Modus mal schnell ändern

Ab und zu muss ich mal den Sleep-Modus meines Books ändern, dazu das Skript hier:Sleepmode?
Code zum markieren einmal anklicken

set current_mode to last word of (do shell script "pmset -g | grep hibernatemode")


if current_mode as text = "0" then

set diame_text to "Current Mode is:

0 - Old style sleep mode, with RAM powered on while

sleeping, safe sleep disabled, and super-fast wake."

else if current_mode as text = "1" then

set diame_text to "Current Mode is:

1 - Hibernation mode, with RAM contents written to disk, system totally shut down while “sleeping,” and slower wake up, due to reading the contents of RAM off the hard drive."

else if current_mode as text = "3" then

set diame_text to "Current Mode is:

3 - The default mode on machines introduced since about fall 2005. RAM is powered on while sleeping, but RAM contents are also written to disk before sleeping. In the event of total power loss, the system enters hibernation mode automatically."

else if current_mode as text = "5" then

set diame_text to "Current Mode is:

5 - This is the same as mode 1, but it’s for those using secure virtual memory (in System Preferences -> Security)."

else if current_mode as text = "7" then

set diame_text to "Current Mode is:

7 - This is the same as mode 3, but it’s for those using secure virtual memory.


3 - The default mode on machines introduced since about fall 2005. RAM is powered on while sleeping, but RAM contents are also written to disk before sleeping. In the event of total power loss, the system enters hibernation mode automatically."

end if

display dialog diame_text buttons {"OK"} default button 1

set thelist to {"1 • Write RAM to Disk (slow but save)", "3 • Write RAM to disk and keep RAM power (faster wakeup &save)", "5 • This is the same as mode 1, but it’s for those using secure virtual memory (in System Preferences -> Security)", "7 •  This is the same as mode 3, but it’s for those using secure virtual memory."}

set themode to choose from list thelist with prompt "Which hibernation do you want?"


if themode false then

set t to word 1 of (themode as text)

do shell script "pmset -a hibernatemode " & t with administrator privileges

end if

This entry was posted in OS X. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

2 Trackbacks

  1. [...] hand anzulegen. Will man jedoch etwas mehr bietet sich wie so oft AppleScript an …. bei Hubi gibts schon einen Grobentwurf den man so direkt nützen kann - oder aber an die eigenen [...]

  2. By Der bessere Schlaf - apfelquak on August 3, 2009 at 12:01 pm

    [...] Verhalten aber einfach nur öfter verändern, bietet sich zum Beispiel das AppleScript von HubiononMac an. Gequakt von Piet Abgelaicht in Tutorials Quak dazu geben... | Tweet [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CAPTCHA:


− five = 2

Subscribe without commenting

  • Seite übersetzen:


    Paypal for Pizza:




  • Kategorien


  • Letzte Kommentare

    • Niklas: Vielen Vielen Dank! So klappt es!
    • hubi: Servus Niklas, ich habe mir den Quellcode noch einmal angesehen und habe nun unter 10.7.3 einen Weg gefunden...
    • Niklas: Klingt super das Script. Leider bekomm ich immer folgende Fehlermeldung: error “„Mail“ hat einen Fehler...
    • Jürgen: Hallo Hubi, beim Abfragen von Kennworten gibt es noch eine böse Falle: Das Format, in dem security antwortet,...
    • hubi: Am einfachsten Du öffnest im AppleScript-Editor mal das Funktionsverzeichnis (unter Ablage) von iTunes. Ein...