12,278
edits
mNo edit summary |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
left: a digital one, right: an analogue one | 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 33: | 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 <tt>cron, init</tt> and <tt>at</tt> 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 64: | Line 69: | ||
play document "my_sound.wav" | play document "my_sound.wav" | ||
end tell | end tell | ||
</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> | </source> | ||