12,275
edits
mNo edit summary |
mNo edit summary |
||
(10 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
[[File:Zeitschaltuhr.jpg|300px]] | [[File:Zeitschaltuhr.jpg|300px]] | ||
left: a digital one, right: an analogue one | |||
== Raspberry Pi == | |||
Very useful inexpensive Linux Computer you can use for all kinds of scenarios. For example to play back a video in an exhibition: [[/RaspberryPi/]] | |||
== Startup and shutdown == | == Startup and shutdown == | ||
Line 12: | Line 19: | ||
[[File:Energie sparen.png]] | [[File:Energie sparen.png]] | ||
It is a good idea to tick the box that the computer will restart after a power failure. | |||
[[File:Zeitplan.png]] | [[File:Zeitplan.png]] | ||
Line 29: | Line 38: | ||
[http://www.osxsoft.net ScreenUtil] lets you set the screen resolution over the command line. | [http://www.osxsoft.net ScreenUtil] lets you set the screen resolution over the command line. | ||
=== launchd === | === launchd === | ||
launchd is the service in OS X that replaces the UNIX cron init and at commands | launchd is the service in OS X that replaces the UNIX <tt>cron, init</tt> and <tt>at</tt> commands. Put the configuration files into <tt>~/Library/LaunchAgents</tt> | ||
== AppleScript == | == AppleScript == | ||
Line 37: | Line 46: | ||
-- wenn nicht Mittwoch, Samstag oder Sonntag it, dann schalte den rechner wieder aus. | -- wenn nicht Mittwoch, Samstag oder Sonntag it, dann schalte den rechner wieder aus. | ||
set | set closedDays to {Monday, Tuesday, Thursday, Friday} | ||
if | if closedDays contains ((current date)'s weekday) then | ||
tell application "System Events" | tell application "System Events" | ||
shut down | shut down | ||
Line 61: | Line 70: | ||
end tell | end tell | ||
</source> | </source> | ||
To time events use iCal and run scripts on specific (repeating) entries. This creates <tt>launchd</tt> events. Alternatively use <tt>launchd</tt> directly. If you have an AppleScript running in a loop you may want to exit this loop at a specific time like this: | |||
<source lang="applescript"> | |||
repeat | |||
set currentMinute to minutes of (current date) | |||
set currentHour to hours of (current date) | |||
if (currentHour = 17) then | |||
if (currentMinute > 50) then | |||
tell application "System Events" | |||
shut down | |||
exit repeat | |||
end tell | |||
end if | |||
end if | |||
delay 0.3 | |||
end repeat | |||
</source> | |||
* [http://developer.apple.com/library/mac/#documentation/AppleScript/Conceptual/AppleScriptX/AppleScriptX.html AppleScript introduction] | |||
== Automator == | == Automator == | ||
Automator is an application in Mac OS X which lets you automate tasks in a very easy way. | Automator is an application in Mac OS X which lets you automate tasks in a very easy way. | ||
* [http://developer.apple.com/library/mac/#documentation/AppleApplications/Conceptual/AutomatorConcepts/Automator.html#//apple_ref/doc/uid/TP40001450 Automator reference] | |||
[[Category:AppleScript]] | |||
[[Category:Automation]] | |||
[[Category:Programmiersprachen]] | |||
[[Category:OS X]] |