Fernseherinnerung
Einer der meistformulierten Wünsche für EyeTV ist die Möglichkeit Erinnerungen anlegen zu können, ohne die Sendung gleich zu programmieren. Ich habe mir dieses Thema mal vorgenommen und herausgekommen ist das folgende Script. Es soll als Ausgangspunkt für weitere Anpassungen dienen, denn jeder hat andere Ansprüche an den eigenen Workflow. Feedback hierzu ist natürlich willkommen.
-- ScheduleCreated.scpt
on ScheduleCreated(programID)
tell application "EyeTV"
-- show dialog what to do
display dialog "Do what?" buttons {"Schedule", "Schedule and set reminder", "Don´t schedule, just remind"} default button 2
set the button_pressed to the button returned of the result
if the button_pressed is "Schedule" then
-- do nothing
else if the button_pressed is "Schedule and set reminder" then
-- schedule and set reminder
-- activate the following codeblock to get asked which calendar should be used
(*
tell application "iCal"
set a to get name of calendars
-- end tell
set b to choose from list a
set c to b as string
end tell
*)
tell application "EyeTV"
set programIDInteger to programID as integer
set sched to program id programIDInteger
set theTitle to title of sched
set theTime to start time of sched
--change amount and type of time in second brackets to adjust alarm settings
set theAlarmTime to (start time of sched) - (5 * minutes)
set theDesc to description of sched
-- display dialog "ScheduleCreated: " & theTitle & " " & theTime
end tell
tell application "iCal"
-- set to c if you have enabled the codeblock asking for the calendar, or hardcode your own calendar
set this_calendar to calendar "Test"
tell this_calendar
set theTVEvent to make new event at end of events of this_calendar with properties {summary:theTitle, description:theDesc, start date:theTime, allday event:false}
make new display alarm at the beginning of theTVEvent with properties {trigger date:theAlarmTime}
end tell
end tell
else
-- just set reminder, schedule will be immediately deleted after reminder is set
-- activate the following codeblock to get asked which calendar should be used
(*
tell application "iCal"
set a to get name of calendars
-- end tell
set b to choose from list a
set c to b as string
end tell
*)
tell application "EyeTV"
set programIDInteger to programID as integer
set sched to program id programIDInteger
set theTitle to title of sched
set theTime to start time of sched
--change amount and type of time in second brackets to adjust alarm settings
set theAlarmTime to (start time of sched) - (5 * minutes)
set theDesc to description of sched
-- display dialog "ScheduleCreated: " & theTitle & " " & theTime
end tell
tell application "iCal"
-- set to c if you have enabled the codeblock asking for the calendar, or hardcode your own calendar
set this_calendar to calendar "Test"
tell this_calendar
set theTVEvent to make new event at end of events of this_calendar with properties {summary:theTitle, description:theDesc, start date:theTime, allday event:false}
-- by changing the alarm type to open file alarm another script could be called from here to further adjust the workflow
make new display alarm at the beginning of theTVEvent with properties {trigger date:theAlarmTime}
end tell
end tell
-- delete schedule, so just the reminder in iCal is generated but no recording will take place
tell application "EyeTV"
delete sched
end tell
end if
end tell
end ScheduleCreated


März 11th, 2009 at 12:59
Ich wollte das Script testen. Allerdings bisher erfolglos. Es passiert nichts.
Ich habe es als .scpt abgespeichert und in den Skriptordner ~library/scripts/EyeTv gelegt. Testweise auch in der library des Benutzerverzeichnisses. Es erscheint auch im Apple Script in der Menuleiste.
Ist irgendetwas grundsätzlich falsch oder nicht kompatibel ?
EyeTv 3.1
Mac OS X 10.5.6
Januar 7th, 2011 at 13:52
Bitte hierfür das Manual von EyeTV konsultieren. Dort ist genau beschrieben wo und wie Triggerscripte abgelegt sein müssen.