Line Breakers in Content of Dates #419
-
I synchronise from a WebCal source that I have renamed as ical (http). Unfortunately, the descriptions in the appointments are without line breaks, in a continuous chain. How do I get the line breaks from an HTML format of the source correctly in Google Calendar? Who else has had this problem? |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 4 replies
-
Are there any indicators left of where the linebreaks should be? |
Beta Was this translation helpful? Give feedback.
-
Dear Derek,
Great to get your answer so quickly. THANK YOU!
Well, we export basically from a very comprehensive software solution in HTML format.
Souce file in HTML Code:
<div><b>Flug:<br></b></div>
<div><p><span>Wien – Zürich 07:00 – 08:25 / OS 561<br>Zürich – Florenz 12:50 – 14:05 / LX 1674</span></p><p><span>Kontaktperson vor Ort: <a href=tel:00393407761429 target="">Alessandro</a><br></span></p></div>
<div><b>Transfer </b>von Florenz nach Pistoia von VA organisiert.</div>
<p><b><br>Hotel:<br></b><span>PALAZZO 42 - </span><span>boutique hotel & suites </span><span style="color: black;"></span><span style="color: black;"><br>Via Curtatone e Montanara, 42 - Pistoia <br></span><span><a href=http://www.palazzo42.it>www.palazzo42.it<br></a>Tel. <b>+39<http://www.palazzo42.it%3cbr%3e%3c/a%3eTel. %3cb%3e+39> 0573 569268</b></span></p><!--StartFragment-->
<p><b>18:30 Soundcheck</b><br>19:30 Doors<br><b>20:30 Konzert</b><br><!--StartFragment-->THE BIG B's<!--EndFragment--><br></p>
<p><b></b>Klavier: tba<br>Kontrabass: <span style="color: #000000;">Italian Bass Paltrinieri xix century w strings</span><!--EndFragment--><b><br></b></p>
Source text in clear display:
Flug:
Wien – Zürich 07:00 – 08:25 / OS 561
Zürich – Florenz 12:50 – 14:05 / LX 1674
Kontaktperson vor Ort: Alessandro
Transfer von Florenz nach Pistoia von VA organisiert.
Hotel:
PALAZZO 42 - boutique hotel & suites
Via Curtatone e Montanara, 42 - Pistoia
www.palazzo42.it
Tel. +39 0573 569268
18:30 Soundcheck
19:30 Doors
20:30 Konzert
THE BIG B's
Klavier: tba
Kontrabass: Italian Bass Paltrinieri xix century w strings
Source code with line breakers made visible (Outlook/Word):
***@***.***
I have now still switched back to the GSyncit setup to obtain the correct formatting. But this software is quite unstable and slow. That’s why I like to resolve it with a Script. It is simply more professional.
Please see the correct and desired format of the synchronized appointment entry from the google calendar, it looks like this.
***@***.***
But if I sync with your GREAT (THANK YOU!!!) script, we get the whole text without line breakers.
Can I change the “helpers” code, and exchange the \r\n with something to make this work?
We could even sync with full html format, because my software provides the html code.
Many, many thanks for your valuable support!
Best wishes
Christian
P.S.: I use your latest code, because I also had the issue with duplicate and multiplied entries.
This code now works very fine!
From: jonas0b1011001 ***@***.***>
Sent: Wednesday, March 6, 2024 9:04 PM
To: derekantrican/GAS-ICS-Sync ***@***.***>
Cc: Prof. Christian Buchmann ***@***.***>; Author ***@***.***>
Subject: Re: [derekantrican/GAS-ICS-Sync] Line Breakers in Content of Dates (Discussion #419)
Are there any indicators left of where the linebreaks should be?
—
Reply to this email directly, view it on GitHub<#419 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ASB46XT2COKBE4GEDRFRFR3YW5ZCXAVCNFSM6AAAAABEJKDE7KVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DMOJYGUYTK>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
Google calendar will correctly format html code. So if you can change event descriptions to be proper html, it should work right away. |
Beta Was this translation helpful? Give feedback.
-
Ah, thank you very much.
Do you want to have the webcal address so that you can see what comes along?
From: jonas0b1011001 ***@***.***>
Sent: Wednesday, March 6, 2024 9:37 PM
To: derekantrican/GAS-ICS-Sync ***@***.***>
Cc: Prof. Christian Buchmann ***@***.***>; Author ***@***.***>
Subject: Re: [derekantrican/GAS-ICS-Sync] Line Breakers in Content of Dates (Discussion #419)
We could even sync with full html format, because my software provides the html code.
Google calendar will correctly format html code. So if you can change event descriptions to be proper html, it should work right away.
—
Reply to this email directly, view it on GitHub<#419 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ASB46XVGD7BG6CXYIMTEG33YW546LAVCNFSM6AAAAABEJKDE7KVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DMOJYHAYDS>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
Dear Derek,
as I have developed the software but not actually programmed it, I’d like to provide a Webcal link to you which contains the format as we get if from my platform.
Can you please take a look at this?
webcal://booking.buchmann.at/service/exportprojects/icsmultiple/101/all/single/06.03.2024_01.01.2099/de_AT
I have added a test user for this purpose and it contains only 2 appointments, bout you see the format.
At the current implementation of your script, I have renamed the webcal to https, despite I saw that you new script does rename a webcal anyway.
Many thanks for your extremely valuable support.
Best wishes
Christian
From: jonas0b1011001 ***@***.***>
Sent: Wednesday, March 6, 2024 9:43 PM
To: derekantrican/GAS-ICS-Sync ***@***.***>
Cc: Prof. Christian Buchmann ***@***.***>; Author ***@***.***>
Subject: Re: [derekantrican/GAS-ICS-Sync] Line Breakers in Content of Dates (Discussion #419)
This would make it easier if you need any assistance.
However if i understand you correctly, your software can output html in the ics. If that's the case there will be no changes necessary to the script.
—
Reply to this email directly, view it on GitHub<#419 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ASB46XXCKJOLFKJ3B4XE7PLYW55UNAVCNFSM6AAAAABEJKDE7KVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DMOJYHA2TK>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
… this would be the ical file from the browser: and the html format of the description contains <br> as the line breakers.
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VTIMEZONE
TZID:Arctic/Longyearbyen
X-LIC-LOCATION:Arctic/Longyearbyen
BEGIN:STANDARD
DTSTART:16011028T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010325T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
UID:1127571f8ddbd5584e87aeb93219fbf5
DTSTAMP:20240306T205136
DTSTART;VALUE=DATE:20240310
DTEND;VALUE=DATE:20240311
CATEGORIES:Konzert, Hotel
DESCRIPTION:Transfer von Pistoia nach Bologna Airport durch Alessandro.12:40 Abflug Bologna-Bari (FR549)14:00 Ankunft BariTransfer von Bari Airport nach Altamura durch VA Leonardo Colafelice (künstlerischer Leiter)Hotel:Fuori le MuraVia Maestri del Lavoro 5 – Altamurawww.hotelfuorilemura.it18:00 Soundcheck18:30 Doors19:30 KonzertTHE BIG B'sKlavier: tbaKontrabass: Italian Bass Paltrinieri xix century w strings
SUMMARY:JE ALTAMURA
X-ALT-DESC;FMTTYPE=text/html:<html><head></head><body><p>Transfer von Pistoia nach Bologna Airport durch Alessandro.<br/>12:40 Abflug Bologna-Bari (FR549)<br/>14:00 Ankunft Bari<br/>Transfer von Bari Airport nach Altamura durch VA<a href=tel:00393283667569 target=""> Leonardo Colafelice</a> (künstlerischer Leiter)<!--EndFragment--><br/></p><p><b>Hotel:<br/></b><a href=https://www.hotelfuorilemura.it/ target="">Fuori le Mura</a><br/>Via Maestri del Lavoro 5 – Altamura<br/>www.hotelfuorilemura.it<b><br/><br/><!--StartFragment--></b><b>18:00<http://www.hotelfuorilemura.it%3cb%3e%3cbr/%3e%3cbr/%3e%3c!--StartFragment--%3e%3c/b%3e%3cb%3e18:00> Soundcheck</b><br/>18:30 Doors<b><br/>19:30 Konzert<br/></b><span style="color: rgb(85, 85, 85);text-align: left;background-color: rgb(255, 255, 255);">THE BIG B's</span><br/></p><p>Klavier: tba<br/>Kontrabass: <span style="color: #000000;">Italian Bass Paltrinieri xix century w strings</span><!--EndFragment--><b><br/></b></p><!--EndFragment--><p></p></body></html>
LOCATION:Teatro Mercadante
END:VEVENT
BEGIN:VEVENT
UID:3ac4d02fccebb4c6fa54900f2286c152
DTSTAMP:20240306T205136
DTSTART;TZID=Arctic/Longyearbyen:20240311T153500
DTEND;TZID=Arctic/Longyearbyen:20240311T171000
CATEGORIES:Reise
DESCRIPTION:Transfer Altamura-Bari Airport durch Leonardo ColafeliceRyan Air Reservierungs-No.: UIZ9XV
SUMMARY:JE Flug FR9483
X-ALT-DESC;FMTTYPE=text/html:<html><head></head><body><p>Transfer Altamura-Bari Airport durch <span style="color: #000000;"><a href=tel:00393283667569 target="">Leonardo Colafelice</a></span><!--EndFragment--><br/></p><p>Ryan Air Reservierungs-No.: UIZ9XV</p></body></html>
LOCATION:Bari-Wien
END:VEVENT
BEGIN:VEVENT
UID:04cc536de28843761356aaaa97e01605
DTSTAMP:20240306T205136
DTSTART;VALUE=DATE:20240327
DTEND;VALUE=DATE:20240328
CATEGORIES:Konzert
DESCRIPTION:Kontrabass mitbringen!Ansprechperson vor Ort: Helene SeiderHotel:SCHÜTZEN HOTELS RHEINFELDENBahnhofstrasse 19, CH-4310 Rheinfelden, T +41 61 836 25 25Serie von Christoph Müller19:00 Soundcheck19:30 Doors20:00 KonzertThe Big B's 2-Set8 Freikarten
SUMMARY:JE RHEINFELDEN (CH)
X-ALT-DESC;FMTTYPE=text/html:<html><head></head><body><p><b></b>Kontrabass mitbringen!<!--EndFragment--><b><br/></b></p><p><b></b>Ansprechperson vor Ort:<b> <a href=tel:0041788901993 target="">Helene Seider</a><br/></b></p><p><b>Hotel:</b><br/><span>SCHÜTZEN HOTELS RHEINFELDEN<br/>Bahnhofstrasse 19, CH-4310 Rheinfelden, T +41 61 836 25 25</span></p><p>Serie von Christoph Müller</p><p><b>19:00 Soundcheck<br/>19:30 Doors<br/>20:00 Konzert</b><br/></p><p><b>The Big B's </b>2-Set</p><p>8 Freikarten<br/></p></body></html>
LOCATION:Kurbrunnenanlage Rheinfelden Musiksaal
END:VEVENT
END:VCALENDAR
From: Prof. Christian Buchmann
Sent: Wednesday, March 6, 2024 9:50 PM
To: 'derekantrican/GAS-ICS-Sync' ***@***.***>; derekantrican/GAS-ICS-Sync ***@***.***>
Cc: Author ***@***.***>
Subject: RE: [derekantrican/GAS-ICS-Sync] Line Breakers in Content of Dates (Discussion #419)
Dear Derek,
as I have developed the software but not actually programmed it, I’d like to provide a Webcal link to you which contains the format as we get if from my platform.
Can you please take a look at this?
webcal://booking.buchmann.at/service/exportprojects/icsmultiple/101/all/single/06.03.2024_01.01.2099/de_AT
I have added a test user for this purpose and it contains only 2 appointments, bout you see the format.
At the current implementation of your script, I have renamed the webcal to https, despite I saw that you new script does rename a webcal anyway.
Many thanks for your extremely valuable support.
Best wishes
Christian
From: jonas0b1011001 ***@***.******@***.***>>
Sent: Wednesday, March 6, 2024 9:43 PM
To: derekantrican/GAS-ICS-Sync ***@***.******@***.***>>
Cc: Prof. Christian Buchmann ***@***.******@***.***>>; Author ***@***.******@***.***>>
Subject: Re: [derekantrican/GAS-ICS-Sync] Line Breakers in Content of Dates (Discussion #419)
This would make it easier if you need any assistance.
However if i understand you correctly, your software can output html in the ics. If that's the case there will be no changes necessary to the script.
—
Reply to this email directly, view it on GitHub<#419 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ASB46XXCKJOLFKJ3B4XE7PLYW55UNAVCNFSM6AAAAABEJKDE7KVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DMOJYHA2TK>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
Change Lines 464 to 465 in f5c8eb5 to
|
Beta Was this translation helpful? Give feedback.
-
Thank you so much. I could successfully include those lines in the helpers but I am afraid, this edition of your script is the one which is oriented to event id’s instead of the script which prevents the case to duplicate events if the id changes. Where in the later version of your script (helpers) should I replace those lines instead?
SORRY for troubling you.
Many thanks!
C
From: jonas0b1011001 ***@***.***>
Sent: Wednesday, March 6, 2024 10:01 PM
To: derekantrican/GAS-ICS-Sync ***@***.***>
Cc: Prof. Christian Buchmann ***@***.***>; Author ***@***.***>
Subject: Re: [derekantrican/GAS-ICS-Sync] Line Breakers in Content of Dates (Discussion #419)
Change
https://github.com/derekantrican/GAS-ICS-Sync/blob/f5c8eb5ee5b364f1c03175627163c2fb6c724b44/Helpers.gs#L464-L465
to
if (event.hasProperty('x-alt-desc')){
newEvent.description = event.getFirstPropertyValue('x-alt-desc');
}
else{
newEvent.description = icalEvent.description;
}
—
Reply to this email directly, view it on GitHub<#419 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ASB46XQIZ63MJQNBQBW6CADYW572NAVCNFSM6AAAAABEJKDE7KVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DMOJZGAZTQ>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
I think I made it work!
As soon as I am sure that the script is dong its job, which is strongly think it is, I will donate an amount for your efforts!
Many thanks
Christian
From: jonas0b1011001 ***@***.***>
Sent: Wednesday, March 6, 2024 10:57 PM
To: derekantrican/GAS-ICS-Sync ***@***.***>
Cc: Prof. Christian Buchmann ***@***.***>; Author ***@***.***>
Subject: Re: [derekantrican/GAS-ICS-Sync] Line Breakers in Content of Dates (Discussion #419)
The referenced code should not have changed in quite some time, you should be able to find those exact two lines in your files, the line numbers might be different though.
For the changes to take effect, you will have to sync to a different calendar or remove the previously synced events from your current target calendar.
—
Reply to this email directly, view it on GitHub<#419 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ASB46XWMSKJMYAVTUT56NRLYW6GK3AVCNFSM6AAAAABEJKDE7KVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DMOJZGUYTM>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
Hey, deutsch. Ich dachte Du wärst von sonstwo.
Klasse.
Ich habe jetzt nur noch das Problem, dass beim Syncen im Moment die Daten massenweise gelöscht werden und wieder dazukommen.
Außerdem sind alle mit einem 30-Minutigen Reminder ausgestattet, was nicht sein soll.
var howFrequent = 15; // What interval (minutes) to run this script on to check for new events
var limitSyncRange = false; // If you turn this to "true", only events taking place between syncStartDate and syncEndDate will be synced
var ignoreEventIDs = true; // Turn to true to ignore the original event ids and let the script calculate new ones. Only needed if event ids are not persistent between runs.
var onlyFutureEvents = false; // If you turn this to "true", past events will not be synced (this will also removed past events from the target calendar if removeEventsFromCalendar is true)
var addEventsToCalendar = true; // If you turn this to "false", you can check the log (View > Logs) to make sure your events are being read correctly before turning this on
var modifyExistingEvents = true; // If you turn this to "false", any event in the feed that was modified after being added to the calendar will not update
var removeEventsFromCalendar = true; // If you turn this to "true", any event created by the script that is not found in the feed will be removed.
var addAlerts = "no"; // Whether to add the ics/ical alerts as notifications on the Google Calendar events or revert to the calendar's default reminders ("yes", "no", "default").
(das hatte ich davor auf „false“, und trotzdem kamen die Reminders)
var addOrganizerToTitle = false; // Whether to prefix the event name with the event organiser for further clarity
var descriptionAsTitles = false; // Whether to use the ics/ical descriptions as titles (true) or to use the normal titles as titles (false)
var addCalToTitle = false; // Whether to add the source calendar to title
var addAttendees = false; // Whether to add the attendee list. If true, duplicate events will be automatically added to the attendees' calendar.
var defaultAllDayReminder = -1; // Default reminder for all day events in minutes before the day of the event (-1 = no reminder, the value has to be between 0 and 40320)
// See #75 for why this is neccessary.
var overrideVisibility = ""; // Changes the visibility of the event ("default", "public", "private", "confidential"). Anything else will revert to the class value of the ICAL event.
var addTasks = false;
Ich lass das jetzt mal über Nacht laufen und schau es mir morgen in der Früh nochmals an.
LG
Christian
From: jonas0b1011001 ***@***.***>
Sent: Wednesday, March 6, 2024 11:14 PM
To: derekantrican/GAS-ICS-Sync ***@***.***>
Cc: Prof. Christian Buchmann ***@***.***>; Author ***@***.***>
Subject: Re: [derekantrican/GAS-ICS-Sync] Line Breakers in Content of Dates (Discussion #419)
Awesome, let us know if any further issues arise.
…________________________________
Beste Grüße aus D
—
Reply to this email directly, view it on GitHub<#419 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ASB46XTUYRXG6MDGHU4LAJ3YW6IL3AVCNFSM6AAAAABEJKDE7KVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DMOJZGY3TG>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
-
I'll mark this as answered by the code change above. Welche Version benutzt du denn genau? Das Verhalten kam erst nachdem du den Code von hier geändert hast? |
Beta Was this translation helpful? Give feedback.
-
Thank you very much.
I could make this work by setting the value to “default”, but after thorough testing, there are a few issues.
E.g. if I move an appointment in the Google Calendar, it is not deleted resp. moved back after next sync.
Appointments which I add manually are not deleted after sync.
Is it possible to enable those features?
I keep testing anyway.
I had a few timeouts of the script. Is this period set by Google or can the timeout be defined?
Best wishes
Christian
From: jonas0b1011001 ***@***.***>
Sent: Thursday, March 7, 2024 6:07 AM
To: derekantrican/GAS-ICS-Sync ***@***.***>
Cc: Prof. Christian Buchmann ***@***.***>; Author ***@***.***>
Subject: Re: [derekantrican/GAS-ICS-Sync] Line Breakers in Content of Dates (Discussion #419)
I'll mark this as answered by the code change above.
For the sake of easier communication we will continue discussing some side topics in german.
…________________________________
Welche Version benutzt du denn genau? Das Verhalten kam erst nachdem du den Code von hier geändert hast?
Mit var addAlerts = "no"; sollten eigentlich keine Standardalarme gesetzt werden, nichtsdestotztrotz geh mal in die Kalendereinstellungen deines Zielkalenders, unter "Terminbenachrichtigungen" müsste der entsprechende Alarm 30min vor Beginn auftauchen.
—
Reply to this email directly, view it on GitHub<#419 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ASB46XV4IXUFBOGK2U33J5LYW7YWXAVCNFSM6AAAAABEJKDE7KVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DOMBSGM2DC>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Beta Was this translation helpful? Give feedback.
Change
GAS-ICS-Sync/Helpers.gs
Lines 464 to 465 in f5c8eb5
to