Problems with Export to iCal

For talk and Help about everything concerning TV-Browser.
Benutzeravatar
bodo
Site Admin
Beiträge: 19635
Registriert: 03 Dez 2003, 19:37
Wohnort: Köln
Kontaktdaten:

Re: Problems with Export to iCal

Beitrag von bodo »

As a alternative, try this script:

Code: Alles auswählen

property myTVCalendar : "TV-Browser"
on stringToList from theString for myDelimiters
	tell AppleScript
		set theSavedDelimiters to AppleScript's text item delimiters
		set text item delimiters to myDelimiters
		
		set outList to text items of theString
		set text item delimiters to theSavedDelimiters
		
		return outList
	end tell
end stringToList


on getDateForISOdate(theISODate, theISOTime)
	local myDate
	-- converts an ISO format (YYYY-MM-DD) and time to a date object
	set monthConstants to {January, February, March, April, May, June, July, August, September, October, November, December}
	
	set theISODate to (stringToList from (theISODate) for "-")
	set theISOTime to (stringToList from (theISOTime) for ":")
	
	set myDate to current date
	
	tell theISODate
		set year of myDate to item 1
		set month of myDate to item (item 2) of monthConstants
		set day of myDate to item 3
	end tell
	tell theISOTime
		set hours of myDate to item 1
		set minutes of myDate to item 2
		set seconds of myDate to 0
	end tell
	
	return myDate
end getDateForISOdate


tell application "iCal"
  if (exists (calendars whose title is myTVCalendar)) then
    set TVBrowserCalendar to first item of (calendars whose title is myTVCalendar)
  else
    set TVBrowserCalendar to make new calendar with properties {title:myTVCalendar}
  end if

  set startDate to my getDateForISOdate("2009-12-24", "16:05")
  set endDate to my getDateForISOdate("2009-12-24", "18:40")

  set props to {start date:startDate, end date:endDate, summary:"RTL - Der große Comedy Adventskalender 2009", description:"RTL - Der große Comedy Adventskalender 2009 24.12.2009 16:05-18:40    "}
  set theEvent to make new event at end of (events of TVBrowserCalendar) with properties props
  make new display alarm at beginning of theEvent with properties {trigger interval:-0}
end tell
jdonato
Full Member
Beiträge: 81
Registriert: 14 Sep 2008, 21:45

Re: Problems with Export to iCal

Beitrag von jdonato »

Hi bodo

I appreciate all your efforts. I am learning a lot and, hopefully, can contribute later.

Findings:
The script runs fine!

The build is giving me problems. I will report back....
Benutzeravatar
bodo
Site Admin
Beiträge: 19635
Registriert: 03 Dez 2003, 19:37
Wohnort: Köln
Kontaktdaten:

Re: Problems with Export to iCal

Beitrag von bodo »

If the build makes problems: use the Plugin TVBConsole, it has a Window that shows you the complete Log-Output and hopefully the AppleScript-error if one occured.
jdonato
Full Member
Beiträge: 81
Registriert: 14 Sep 2008, 21:45

Re: Problems with Export to iCal

Beitrag von jdonato »

I am happy to report that I finally built the latest version with the fix to the exporting to iCal. Everything's working great.

I would like to thank bodo for his help and work towards solving this problem. Everyone building this latest version 3.0 from svn should be able to export successfully to iCal, whether in 24 hour format or AM/PM.

Thanks bodo!!!

So now, TV-Browser is mostly perfect for me. I am only missing the ability to see the original air-date of the shows, and color-coding (new vs. reruns, movies vs. sports vs. news, etc...) :wink:
Benutzeravatar
bodo
Site Admin
Beiträge: 19635
Registriert: 03 Dez 2003, 19:37
Wohnort: Köln
Kontaktdaten:

Re: Problems with Export to iCal

Beitrag von bodo »

jdonato hat geschrieben:So now, TV-Browser is mostly perfect for me. I am only missing the ability to see the original air-date of the shows, and color-coding (new vs. reruns, movies vs. sports vs. news, etc...) :wink:
The air-dates should be available in the new data you download. I added that to the svn version a few days ago.
jdonato
Full Member
Beiträge: 81
Registriert: 14 Sep 2008, 21:45

Re: Problems with Export to iCal

Beitrag von jdonato »

bodo hat geschrieben:The air-dates should be available in the new data you download. I added that to the svn version a few days ago.
WOW. I am impressed and extremely grateful!!

Merry Christmas!!
Bananeweizen
Site Admin
Beiträge: 3353
Registriert: 09 Sep 2006, 22:45

Re: Problems with Export to iCal

Beitrag von Bananeweizen »

Color codes detection in SchedulesDirect has also been added four days ago. But it will only be noticable for black&white programs, because only those get a special icon (i.e. there is no differentiation between programs with unknow color code and programs with "color" color code).
And I also added movie detection and MPAA/TV age rating codes. You may need to enable the rating codes in the program info dialog by using the "setup" button in the lower left corner of the dialog.
jdonato
Full Member
Beiträge: 81
Registriert: 14 Sep 2008, 21:45

Re: Problems with Export to iCal

Beitrag von jdonato »

Bananeweizen hat geschrieben:Color codes detection in SchedulesDirect has also been added four days ago. But it will only be noticable for black&white programs, because only those get a special icon (i.e. there is no differentiation between programs with unknow color code and programs with "color" color code).
And I also added movie detection and MPAA/TV age rating codes. You may need to enable the rating codes in the program info dialog by using the "setup" button in the lower left corner of the dialog.

Nice! I have been able to see the MPAA ratings and the little movie icons. Have not seen the color code for black&white movies yet. Got to search a little bit better, holiday reunions got me running everywhere around...
Bananeweizen
Site Admin
Beiträge: 3353
Registriert: 09 Sep 2006, 22:45

Re: Problems with Export to iCal

Beitrag von Bananeweizen »

BTW: I must admit that the detection of the black and white programs is completely untested because I also couldn't find any black/white program in the channels that I used for testing. So if you find some movie which _should_ be black/white, but isn't marked as such, I would appreciate your feedback about that.
Antworten