Tinderbox Forum

Exporting events to ics file possible?

Hi all,

I’m new here and have questions :slight_smile:

But first some background:

Expectation setting:

Not a programmer but can fiddle with scripts.

High level(ish) of what I think I want and why I want it:

Every time I record some chunk of data that gets thrown at me from life, I often find that it contains information that needs to be stored in different applications.

For example: Recent visit to the Eye Hospital with my daughter results in stuff like referral letter, results of examination, date of next appointment at the clinic and a task to make an appointment with the local eye doctor.

So, I ask myself, do I try and store this in Devonthink, Omnifocus, or Mac OS Calendar?

  • Devonthink I love for the referral letter, and results letter and can tag them appropriately

  • Omnifocus can take the task to make the new appointment

  • The next Eye Hospital appointment can be entered into Calendar

Now a couple of things that I’m not happy with. I don’t find the calendar app 100% safe for important appointments because the calendar is shared and it isn’t easy to track who has changed what, especially if it is inadvertent. So I would always like to have the important appointments stored somewhere as a master copy.

Also, and perhaps most importantly, I don’t get a visual picture of how all the bits of information are connected.

Hence Tinderbox :slight_smile:

I have been playing around with Tinderbox, watched some of the excellent videos and looked through the forum. This has helped me begin to connect my information visually with the map view. Have used task and event prototypes, used agents to scan and report appointments which is all lovely. Nothing is finished yet (is it ever) but I’m making progress.

Here is a work in progress version the map which helps me see the big picture of my daughter’s treatment:

A few notes/observations:

Results letters are stored in Devonthink but are linked to in the relevant Tinderbox note which is great.

Tasks I can make do with copying manually to Omnifocus where necessary or working directly out of Tinderbox (I’ve read the thread about using Tinderbox with external task planners).

The appointments though are the weak point. I have to make sure I manually duplicate (aargh!) them in Calendar (see safety concern above) to remind me when they are due and to help plan out the more short term stuff that never makes it into Tinderbox.

I don’t have Tinderbox with me all the time but the Calendar and Omnifocus I do.

Now, what, after all that preamble am I asking? :slight_smile:

I was wondering if anyone has managed to, say, have an agent running that collects all the events in a tbx file and somehow exports them to an ics file that can be subscribed to in Calendar apps?

This way, I would have one place to enter the important stuff and I can even lock the event in Tinderbox which makes me feel all warm and cosy.

Any ideas? Any comments on the idea, however critical would be appreciated.

Thanks in advance,

Jeremy

Is there a built-in template for this? No?

Could user template(s) generate a text ‘.ics’ file? almost certainly, based on looking at the spec: https://icalendar.org/RFC-Specifications/iCalendar-RFC-5545/

I’m pushing a deadline so can’t investigate further, but it looks doable. An agent could find all (current?) future events. he child aliases could then be exported as ICS files. You might need some post processing as there is no method for (HTML) export to export only a selection of notes; you either export the whole doc or one selected note at a time. If the ICS is the only (HTML) export needed, then you just configure the doc so only the alias children of the agent are exported, each as a ‘.ics’ file. Or export all the event data as one text file and then post-process with a script environment of your choice into discrete iCS files. I’m making an assumption (no time for deep reading) that an ics file contains only one event. If it can hold multiples, then the process is easier - just export the agent as a single file using appropriate templates to process all the child aliases into the single ICS payload.

Sorry I’ve not time to dig further on this but I hope it helps you (and others here) to get traction on the project.

Writing an .ics exporter is doable – I’ve done it a few times out of curiosity – as @mwra says it’s just a text file. However you cannot “subscribe” to an .ics file in Calendar. It is for data transport from application A to application B. Once the .ics is imported to Calendar (or other app) it is not monitored by Calendar for changes. You have to reexport the events and then import them again (deleting the old event to clean up the calendar).

BUT if the real issue is you don’t trust whoever you share your calendar with, why write software to protect yourself? I don’t mean this critically, but it’s really not the highest use of Tinderbox, in my opinion.

Either (a) don’t share the calendar, (b) take your calendars out of iCloud and make them all local, or © create a Google account just for yourself and use the calendar there for your private appointments? (You can also sync a Google calendar to Calendar, but if you don’t trust whoever is looking at your Calendar, that’s problem not a good thing.)

1 Like

Thanks Mark and Paul for taking the time to read my longish post.

Seems nobody has done this so that’s already a result in the sense it’s better knowing where one stands than not :slight_smile:

Regarding ics files, I believe they can contain more than one event but don’t have to. I need to research this further.

I read a short post here ( https://stackoverflow.com/questions/1156140/how-to-create-an-icalendar-feed-that-people-can-subscribe-to ) that seemed to suggest it is fairly simple to host an ics file on a web server and then get Calendar to subscribe to it. Again, having never done this, I’m still researching. It may well turn out that the technical solution is beyond my capabilitiy anyway :slight_smile:

And as Paul points out, I have to ask myself: is there value in doing it?

In an ideal world (for me), I would have a Calendar that if I clicked on a date, I would then be one click away from switching to map view in Tinderbox with the cursor on the linked note.

As a stepping stone, I still like the idea that Tinderbox would be the definitive repository for important dates and everything that is connected with that date. If I can at least semi automate the data transfer to the Calendar it would be good.

Regarding trusting people I share the calendar with, maybe I gave the wrong impression in my original post. What I was trying to say was that electronic calendars can be a bit fragile when shared with multiple devices. I’ve had sync problems in the past that deleted events and the trouble is, there is no easy undo button that I’m aware of. Pity that each change to a calendar isn’t like a commit to git or the like so you could easily see the change trail :slight_smile:

I’ll look a bit deeper and see what I come up with and post back if I have some success.

In which case, you’d want to embed a Tinderbox URL into the event data, though note the latter feature is itself still slightly a work-in-progress - see the link for more info.

1 Like

Why not forget calendars, rolling your own ICS exports, etc., then and just use Tinderbox for all your plans and notes?

Portability mainly. I have a phone (sometimes an iPad) with me when I’m out and about. It’s also important that the family can see the family calendar and they only have phones.

I see Tinderbox as mostly being used at home with a big screen. Make sense?

Of course it makes sense. :smile:

If your experiments with ICS and your personal calendar management see light of day I’m sure folks here will like to see the results.

1 Like

An overdue update:

I discovered Curio and found that it had date sync with calendars built in…so off I went…

But I never got on with it so I’m back with Tinderbox and have returned to this post feeling a bit guilty of leaving it hanging.

So, with a helpful nudge from Mark, here is a proof of conceptish attempt at the iCalendar export.

I will stress that this works with the data in the Tinderbox file but has not been tested beyond. It’s basically a two day attempt to see how much I could manage and learn from pretty much zero. So, it’s basic. For example the timezone information is assumed and hard coded in the template.

There are a couple of questions at the bottom of the main ‘Goal and Notes’ note that could do with answers if any of you have them.

In case it isn’t obvious, select the agent EXPORT ME and export it (not the whole file). It should generate a file called EventAppts.ics. You may have to adjust the ‘Export to’ path in the export tab in the inspector.

If you have a webdav server you can export it to the server and then subscribe to it with Mac Calendar although I’ve only tested it with Busycal - should be the same though.

If you change one of the Events or Appointments in the Tinderbox file and re-export to the webdav server, the calendar will update accordingly after a refresh.

If you look at the calendar event via a calendar app that is on your Tinderbox machine, you will see that it includes an URL that, when clicked, takes you to the event in the agent in the Tinderbox file. Command R will take you to the original.

Suggestions and answers to the two questions welcome :slight_smile:

icsexport.tbx (193.1 KB)

1 Like

Nice idea and the effort is appreciated.

But … does this concept achieve anything special that selecting a note and choosing the a share extension such as File > Share > Add to Fantastical (or other if available) does?

There’s no two-way integration between Tinderbox and calendars, so either method just adds an event or reminder?

@PaulWalters. I think File ▸ Share ▸ Add to Fantastical assumes that all the information for the event is contained in the text selection. Jeremy Harrison is working with notes where dates are stored in $StartDate and $DueDate. So we need to export this information in a format that calendars can readily import.

Sorry, I don’t have fantastical so I’m not sure. Could I ask what happens if you alter the original event’s dates in Tinderbox and then share it again. Do you get two fantastical events and do you then have to manually delete the obsolete one?

Downloaded Fantastical and had a quick play.

  • Yes, you can do a File>>Share>>Add To Fantastical and it will take a single note. However as mentioned above it ignores the Tinderbox Date Attributes.
  • It will scan the body text for a date and suggest it to you in Fantastical.
  • It is just an export, and once exported it has no further connection with Tinderbox.
  • If you reexport the item, you get another duplicate event.
  • If you delete the item in Tinderbox you have to go and find the event in Fantastical and delete it there.
  • You can only ‘share’ one note at a time

If you try and share the contents of an agent, nothing happens.

If you do what I’m trying to do:

  • The agent automates gathering all the events and appointments in a Tinderbox file.
  • When an export is done, it generates a single .ics file for all the events and appointments.
  • Because it is a .ics file you are not tied into target application integrations as nearly all calendar apps speak .ics .
  • The target calendar app subscribes (i.e not imported) to the generated .ics file. So, if you delete or change the information in the Tinderbox file, at the next export, the old appointments disappear to be replaced by the new ones. So no need to seek out old stuff to alter or delete in the target calendar app.
  • The events in the calendar app are read only so you can’t change them. For my use case this is what I wanted as the events are primarily for a shared calendar.

Can we call it a one way integration? :grinning: