Tasks & Events from Calendar.app and OmniFocus into Tinderbox

I need to transfer my calendar-events into Tinderbox.

Fantastical2.app

Bringing over events from Fantastical2.app (either copy/paste or drag/drop) is not recommended here; for StartDates and EndDates aren’t brought along.

Calendar.app

Bringing over events from Calendar.app (either copy/paste or drag/drop) works well; since StartDates and EndDates are brought along.

However:

I am missing the backlink option to the respective calendar-event – as displayed e.g. in OmniFocus-Tasks successfully brought over and showing omnifocus:///task/psetesttesttest0qoK0x1u in the URL-attribute.

Ideas???

OmniFocus

Bringing over tasks from OmniFocus2Pro.app (either copy/paste or drag/drop) works well; although StartDates and EndDates aren’t brought along.

Ideas??

However:

A backlink is provided in the URL-attribute … e.g. omnifocus:///task/psetesttesttest0qoK0x1u in the URL-attribute.

which attributes are brought along

How does one figure out which attributes an imported note/event/task brought along (like URL-backlink, StartDate etc.)

Usually when a dragged-in or pasted item creates attributes or assigns values to existing assets, Tinderbox displays these in the Key Attributes for that note. The KA display usually is automatically opened to show you what these adds are.

Thank you Paul.

OmniFocus

I see what you mean and that works perfectly well for tasks brought over from OmniFocus (as described above); since the backlink – assigned to the TB-URL-attribute – is automatically displayed as Key Attribute.

Calendar.app

Start and end of Calendar.app-events are assigned to $StardDate and $EndDate in TB. But both aren’t displayed as Key Attributes automatically.

Devonthink

The same applies for files brought over from Devonthink:

  • Although Devonthink-files bring backlink along (assigned to TB-URL-attribute), it is not automatically displayed as Key Attribute.
  • –> Thus, one has to already know for which attributes to look out.
  • If a Devonthink-file has one tag – this tag is assigned to $Tags. But again: Not automatically displayed as Key Attribute.
  • But once a Devonthink-file has more than 1 tag – none of them is assigned to $Tags anymore.

Scrivener

Or take Scivener-projects. One can either drag them in or even open them as new TB-file. All the Scrivener-attributes are brought over – but not displayed as Key Attributes automatically …


… which brings me back to my original question:

How does one figure out which attributes an imported note/event/task brought along (like URL-backlink, StartDate etc.)

I believe your second post answers your own question – you listed already what is imported.

OF - drag/paste adds OF url to $URL
DEVONthink – $URL and $Tags
Scrivener – you’ve see already what happens

Scrivener can have custom attributes, so your results may vary from the standard depending on your own set up.

One “figures out” these things by inspection and by reading the release notes for Tinderbox. (I haven’t time to check aTbRef; perhaps @MWRA can chime in.)

…I heard my name. :grinning:

Stepping back, this is an unbounded question: “What from [some app] may get imported, and how do I know?”. Heavy users of [some app] usually follow up with “Why doesn’t Tinderbox find all the things from [some app] that I assume it is providing?”. The reality is less simple.

Those who read the release notes in detail will know some of this integration isn’t simply a case of Tinderbox dropping the ball but requires Eastgate to work with the authors of [some app] (assuming they are even willing) to check sending/receiving apps are doing things the same way. For instance, sometimes [some app] may not document what it puts on the clip board (or in a drag) or mis-declare its data type. As users, we assume this ‘just’ works. My years of beta testing for a variety of apps would suggest otherwise.

This is all a polite roundabout way of saying - are we asking the right question here? The expectation I parse from posts above is an assumption Tinderbox should put all ‘extra’ information, for which it has a suitable (how to tell?) attributes, as KAs. When the unexpected happens, experience shows users blame the receiving app (or the one they use less often/know less well) which isn’t exactly logical.

aTbRef certainly reports support for known apps that have specific per-app support built-in (mainly found here).

Personally, my approach with first testing using data from [some app] with Tinderbox would be this:

  • Try drag/drop or paste into Tinderbox view pane.
  • See what sort of note is made and if any KA are set.
  • If I suspect other data might/should be there, I’d open Get Info, tear off the pop-over, resize to show more data then select the attributes panel and cycle through the attribute groups to see what’s there - any item in bold is non-default).
  • Check some app’s documentation for what data is put into the drag. In no docs, email [some apps]'s dev any ask for detail
  • With clear detail of what’s in the drag and what doesn’t show up, drop an email to Tinderbox support asking if the omission is by design or if it could be supported. I’d be mindful that not everyone uses [some app] with Tinderbox so asking Eastgate to track [some app]'s development and re-test each release might be more dev work than imagined.

Thank you Mark A. for your reply, suggestions, and considerations.

Following your link-suggestion, I found out, for example, that using the Event-Prototype in a TB project triggers the immediate display of the Key Attributes ($StartDate and $EndDate) of any event brought over from Calendar.app. Just what I was asking for in the first place.

For those curious:

  1. I wasn’t aware of the interconnectedness of built-in Prototypes (such as “Event”) and Attributes deriving from Calendar.app. But: The Event-Prototype has to be activated (invoked?) manually BEFORE importing the Calendar.app-Event in order to assign Start- and End-Date to the $StartDate and $EndDate attributes.
  2. Drag-Drop-Importing Data from Bookends, however, does not require to activate the built-in Reference-Prototype manually. TB does it itself.
  3. TaskPaper again handles things differently, since it seems to bring its own PrototypeS – namely “Taskpaper Project” and “Taskpaer Task”.

Nice, once one knows.

Calendar. Testing, it uses a prototype ‘Event’ but only if one is found (assumption: it is the build-in Event, but will take a user-made prototype of that name if present). It would seem more sensible for it to add the Event prototype if not present and apply it (in the manner Bookends data does with ‘Reference’).

TaskPaper. I don’t have this app so can’t test. If I read correctly, adding TaskPaper data to Tinderbox causes 2 new prototype to be added to the TBX - "Taskpaper Project"and “Taskpaper Task” (is that a p or a P in the prototype name?). What attributes do the prototypes set?

Tinderbox 7 uses “Taskpaper” in these prototypes, although the actual name of the app is “TaskPaper”. The Taskpaper (sic) import process could be improved. TaskPaper “due” tags could be parsed into $DueDate since TaskPaper uses a consistent format for the tag:

 @due(2017-10-11)

Also, notes added to projects or tasks in TaskPaper are not imported as the $Text for that project or task, but as separate Notes in Tinderbox.

TaskPaper has very robust AppleScript support and many contributed scripts – including export to OPML.
I personally prefer to use OPML export from apps that support it (or can support it with custom scripts) and then import that OPML to Tinderbox – since this gives me the greatest control on how data is imported and parsed to built-in and User attributes.

1 Like

Thanks. So, adding a TaskPaper item, adds 2 new prototypes - and presumably the /Prototypes container if not already present. What KA are defined for two prototypes? I only ask so I can document it correctly, without having seen it myself.

The two prototypes have the same KA – $DueDate, $Checked, $Tags – all are built-in System attributes. The difference between the prototypes seems to be that “Taskpaper Project” uses a bold face for $Name and “Taskpaper Task” does not.

I’ve noticed another error in the import. In TaskPaper a project or task is completed by adding the tag @done to the item – TaskPaper then displays the completed item in a strikethrough font. When Tinderbox 7 imports that, it correctly displays the strikethrough text and sets $Checked to true, but if the completed item is a project it does not assign the “Taskpaper Project” prototype (or any prototype) to the item.


It should be noted that the only thing that distinguishes TaskPaper files from any other plain text file is the .taskpaper extension. IOW, one can write “TaskPaper” documents in any plain text editor, using the standard four TaskPaper formatting rules, save as .taskpaper and import those into Tinderbox. The four rules are: project lines end with a colon. Task lines begin with a hyphen. Tags begin with the commercial at. Notes do not have hyphens at the beginning.

1 Like

@eastgate
@mwra

Two years down the road – and I still do not understand how to best bring in Events from Calendar-Apps such as Calendar.app or Fantastical (just like bringing in Tasks from Omnifoucs) in order to show Start- and End-Date of a respective Event.

There used to be a workaround in Version TBX 7.x (when instantiating the built in Events-Prototpye). But this does not work any more.

Any suggestions?

Cheers

This isn’t a task I really do so I’m at a loss as to what to suggest. However, I have updated aTbRef8 to use the correct naming of the TaskPaper article.

As I understand it, Taskpaper can set $StartDate, $EndDate and $DueDate; these are system attributes so always present. This is totally unconnected with whether you see those attributes as a KA. The built-in prototype ‘Event’ shows those three attributes as KA - regardless of whether those attributes have values.

However, adding a TaskPaper event to a Tinderbox file doesn’t, AFIAK, either (a) add the event prototype if not present in the Tinderbox and/or (b) apply that prototype to the new note created.

Thanks @mwra for the Taskpaper update.

However, the main focus of my last question really lies on bringing Calendar-Dates or Events into Tinderbox, not so much Taskpaper-Tasks.

And I am somewhat surprised that this should be such a hard thing to achieve in Tinderbox since bringing in all kind of task-related information (like OmniFocus-tasks or Taskpaper-tasks) Calendar-Events in comparison bear just as little information as StartDate and EndDate.

Any ideas @eastgate?

Just to say that I too would appreciate a method to bring events into TB. I confirmed with some testing that it can be done in TB7, but the ability has been lost in TB8

Be sure that Tinderbox is permitted to access your calendar in System Preferences ▸ Privacy; changes in Mojave may require you to grant permission.

We’re currently investigating a Mojave issue where macOS fails to ask for permission, and simply assumes that permission was declined.

1 Like

There doesn’t seem to be a way to grant Calendars access to a chosen app. The dialog doesn’t have an add button.

  • Adding full disk access doesn’t seem to do the trick
  • If relevant, Tinderbox 7 has access - maybe moving it would help?

I can’t figure out how to provide a clickable link back to Calendar (unlike Mail, no URL scheme, so uid here is unused) but, pending a possible future built-in solution, the new AppleScript capabilities in Tinderbox allow you to bring in the start date, end date, summary, description (notes) and location for events in a specific calendar in Calendar. Below is a bare-bones script that does that. Copy-paste into Script Editor (in Applications > Utilities), edit the name of the calendar to match what you have in Calendar, and with a Tinderbox document open, click run. As always make a backup of your Tinderbox document first.

#--------------------------------------------------------------------------------
# Imports events from Calendar into front Tinderbox 8 document
# TO USE: Edit calendar name from "Test" to actual name, and
#              with Tinderbox doc open, click run

property targetCalendar : "Test"

set containerName to "Imported Events"
set keyAttributesStr to "StartDate;EndDate;DueDate;MyString"

# Initialize list variables to hold Calendar event properties
set {summaryLst, descriptionLst, startDateLst, endDateLst, uidLst, locationLst} to {{}, {}, {}, {}, {}, {}}

set importCounter to 0

tell application "Calendar" to tell calendar targetCalendar
	set eventList to events
	set eventCount to eventList's length
	
	# place each Event 'property' in an AppleScript list
	repeat with anEvent in eventList
		tell anEvent
			set end of summaryLst to summary
			set end of descriptionLst to description
			set end of startDateLst to my dateToStr(start date)
			set end of endDateLst to my dateToStr(end date)
			set end of locationLst to location
			set end of uidLst to uid
		end tell
	end repeat
end tell

tell application "Tinderbox 8"
	tell front document
		if not (exists) then error "No Tinderbox document open."
		
		#  create container for imported messages
		if not (exists note containerName) then
			set newNote to make new note at before first note
			tell newNote to set name to containerName
		end if
		
		# create a note for each selected Mail message in designated container
		repeat with i from 1 to eventCount
			set newNote to make new note at note containerName
			tell newNote
				## Map Tinderbox 'attributes' to Calendar event 'properties':
				set value of attribute "Name" to item i of summaryLst
				set value of attribute "Text" to item i of descriptionLst
				set value of attribute "StartDate" to item i of startDateLst
				set value of attribute "EndDate" to item i of endDateLst
				set value of attribute "MyString" to item i of locationLst
				## Assign values to non-Calendar-related attributes:
				set value of attribute "KeyAttributes" to keyAttributesStr
				set value of attribute "Width" to 8
				set value of attribute "Badge" to "clock"
			end tell
			set importCounter to importCounter + 1
		end repeat
		
	end tell
end tell

display notification "Imported " & importCounter & " events of " & eventCount & " total"

# handlers (=subroutines)
to dateToStr(aDate) --> convert AppleScript date to string format that Tinderbox recognizes
	tell aDate to return short date string & ", " & time string
end dateToStr
1 Like

The first time I dragged an event from Calendar into TB and added $StartDate as a key attribute, I was prompted to give TB access to the calendar. It did not, however, populate StartDate.

Dragging subsequent events from Calendar to TB does populate the $StartDate.

Dragging events from Fantastical (my preferred calendar tool) sets $Text to a sort of text representation of the event, something like:

May 28, 2019 at 9:00 AM - 10:00 AM
My meeting name
My meeting location

My meeting notes

No $StartDate though.

The first drag (ever) might well time out if you don’t give permission fast enough. Just repeat it.

I don’t know what Fantastical puts on the clipboard; we could likely support it if there’s sufficient interest.