# EyeTV starten
tell application "EyeTV"
launch
#close every window
# wenn EyeTV nichts aufnimmt, zeige Kanal 1 im Fullscreen an
if not is_recording then
channel_change channel number 1
c
else
# wenn EyeTV etwas aufnimmt, zeige den Kanal von dem gerade aufgenommen wird im Fullscreen an
set startzeit to item 1 of start time of recordings
set a to 1
repeat with i from 1 to number of items in start time of recordings
set this_item to item i of start time of recordings
if this_item > startzeit then
set startzeit to this_item
set a to a + 1
end if
end repeat
set titel to title of recording a
set sender to station name of recording a
set startzeit to actual start of recording a
set dauerbisher to round ((actual duration of recording a) / 60)
set dauergesamt to round ((duration of recording a) / 60)
play recording of unique ID of recording a
c
tell application "GrowlHelperApp"
set the allNotificationsList to {"Test Notification", "Another Test Notification"}
set the enabledNotificationsList to {"Test Notification"}
register as application "Growl AppleScript Sample" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "EyeTV"
-- Send a Notification...
notify with name "Test Notification" title "Aufnahme läuft " & dauerbisher & " von " & dauergesamt & " min" description "" & sender & " - " & titel application name "Growl AppleScript Sample" #with sticky
end tell
end if
end tell
# iTunes starten, wenn Volume "MyBook" gemountet ist
if my checkMyBook() then
launch application "iTunes"
else
delay 5
if my checkMyBook() then
launch application "iTunes"
end if
end if
# Mail starten und Fenster schließen
tell application "Mail"
run
close window 1
end tell
# iTunes Fenster schließen
tell application "System Events"
set visible of every process whose visible is true and name is "iTunes" to false
end tell
on checkMyBook()
try
repeat with i from 1 to 5
set t to do shell script "mount"
if t contains "/dev/disk1s2" then
return true
else
delay 1
# return false
end if
end repeat
on error
return false
end try
end checkMyBook