Compare commits

..

15 commits

Author SHA1 Message Date
David Ingerslev
91aa682979 0.2.1 2025-04-02 09:40:24 +01:00
David Ingerslev
9aade20454 Added note about recurring meetings/appointments 2025-04-02 09:40:09 +01:00
David Ingerslev
16bb41eba6 Added documentation for new helper field 2025-04-02 09:35:19 +01:00
David Ingerslev
69ab0a4b89 0.2.0 2025-04-02 09:26:14 +01:00
David Ingerslev
00735f620e Added helper field for current date/time, helper_currentDT 2025-04-02 09:25:19 +01:00
David Ingerslev
71b4f40d4e 0.1.6 2025-03-30 12:32:11 +01:00
David Ingerslev
5030c9bb16 0.1.5 2025-03-30 12:31:59 +01:00
David Ingerslev
9067271e96 Updating version 2025-03-30 12:31:50 +01:00
David Ingerslev
4e9073e012 Changed import of mustache module to match the import styles of other modules 2025-03-30 12:22:25 +01:00
David Ingerslev
5ac713098c 0.1.4 2025-03-12 06:55:52 +00:00
David Ingerslev
a8b7716030 Updated npm libaries to improve security after Github warning message 2025-03-12 06:54:15 +00:00
David Ingerslev
8ced7ef462 Removed old notice for users that is no longer helpful. 2025-03-12 06:40:18 +00:00
David Ingerslev
e9a0e8d323 0.1.3 2025-03-12 06:38:15 +00:00
David Ingerslev
e88ee9f5aa Improved notices for users 2025-03-12 06:30:22 +00:00
David Ingerslev
e7f3295e60 0.1.2 2025-03-12 06:26:42 +00:00
8 changed files with 997 additions and 854 deletions

View file

@ -1,5 +1,5 @@
Copyright (C) 2020-2025 by Dynalist Inc.
Copyright (C) 2025 David Ingerslev
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View file

@ -12,7 +12,14 @@ By processing .msg files, the plugin does not depend on having to run code withi
Outlook or on Microsoft 365 administrators authorising an app to connect to the
Microsoft Graph API.
It relies on the wonderful [msgreader](https://github.com/HiraokaHyperTools/msgreader),
Note about recurring meetings or appointments: Microsoft Outlook does not include
any fields that indicate which of the recurring appointments has been dragged-and-dropped,
so it is not possible to differentiate between them. This means that the start date/time
of the first appointment in the recurring series will be used by default. You may wish
to change the filename template to include the current date/time instead (or as well)
using the helper field [helper_currentDT](#helper_currentDT).
The plugin relies on the wonderful [msgreader](https://github.com/HiraokaHyperTools/msgreader),
[mustache.js](https://github.com/janl/mustache.js), and
[mustache-validator](https://github.com/eliasm307/mustache-validator) libraries.
@ -69,8 +76,8 @@ Note - the invalid characters are: `/` `*` `"` `\` `<` `>` `:` `|` `?`
The default template can be customised, or you can write a new
template using mustache syntax (see [the manual](https://mustache.github.io/mustache.5.html)).
All .msg [fields](https://hiraokahypertools.github.io/msgreader/typedoc/interfaces/MsgReader.FieldsData.html)
can be used in a template, and there are also some additional helper functions you can
use to format fields.
can be used in a template, and there are also some additional helper fields and
functions you can use to format fields.
### Default template
The default template for notes is:
@ -89,6 +96,19 @@ meeting-invite: {{body}}
---
```
### Helper fields for templates
There is currently only one helper field available:
#### helper_currentDT
The date and time at which the meeting was dragged-and-dropped onto the icon,
in ISO format (like *2025-04-02T09:31:12+01:00*).
You will probably want to use the [helper_dateFormat](#helper_dateFormat) function
to format it:
```
{{#helper_dateFormat}}{{helper_currentDT}}|YYYY-MM-DD HH.mm.ss{{/helper_dateFormat}}
```
### Helper functions for templates
To use a helper function in a template, include a section for the function, e.g.:
```

24
main.ts
View file

@ -1,7 +1,8 @@
import { App, displayTooltip, Editor, MarkdownView, Notice, Plugin, PluginSettingTab, Setting, moment, TooltipPlacement, EventRef } from 'obsidian';
import { App, displayTooltip, Editor, MarkdownView, Notice, Plugin, PluginSettingTab, Setting, TooltipPlacement, EventRef } from 'obsidian';
import MsgReader from '@kenjiuno/msgreader';
import proxyData from 'mustache-validator';
const Mustache = require('mustache');
import Mustache from 'mustache';
import moment from 'moment';
const OutlookMeetingNotesDefaultFilenamePattern =
'{{#helper_dateFormat}}{{apptStartWhole}}|YYYY-MM-DD HH.mm{{/helper_dateFormat}} {{subject}}';
@ -44,18 +45,22 @@ export default class OutlookMeetingNotes extends Plugin {
const { vault } = this.app;
// Get the file data from MsgReader
const fileData = msg.getFileData();
const origFileData = msg.getFileData();
// Check if we got a suitable meeting
if (fileData.dataType != 'msg') {
if (origFileData.dataType != 'msg') {
throw new TypeError('Outlook Meeting Notes cannot process the file. '
+ 'MsgReader did not parse the file as valid msg format.');
} else if (fileData.messageClass != 'IPM.Appointment') {
} else if (origFileData.messageClass != 'IPM.Appointment') {
throw new TypeError('Outlook Meeting Notes cannot process the file. '
+ 'It is a valid msg file but not an appointment or meeting.');
}
this.addHelperFunctions(fileData);
this.addHelperFunctions(origFileData);
// Add helper field for the current date and time
let fileData = origFileData as any;
fileData.helper_currentDT = moment().format();
let folderPath = this.settings.notesFolder;
if (folderPath == '') { folderPath = '/'; }
@ -75,7 +80,7 @@ export default class OutlookMeetingNotes extends Plugin {
let meetingNoteFile = vault.getFileByPath(filePath);
if (meetingNoteFile) {
// File already exists
// TODO: send a message to the user
new Notice(meetingNoteFile.basename + ' already exists: opening it');
}
else {
if (vault.getFolderByPath(newFolderPath) == null) {
@ -85,7 +90,7 @@ export default class OutlookMeetingNotes extends Plugin {
this.settings.notesTemplate,
fileData);
meetingNoteFile = await vault.create(filePath, mustacheOutput);
new Notice('New file: ' + meetingNoteFile.basename);
new Notice('New file created: ' + meetingNoteFile.basename);
}
const openInNewTab = false;
this.app.workspace.getLeaf(openInNewTab).openFile(meetingNoteFile);
@ -94,7 +99,7 @@ export default class OutlookMeetingNotes extends Plugin {
if (fe) { fe.revealInFolder(meetingNoteFile); }
} catch (ee: unknown) {
// TODO: Handle errors reasonably -- differently between msg missing elements and errors creating file
if (ee instanceof Error) { new Notice(ee.name + ':\n' + ee.message); }
if (ee instanceof Error) { new Notice('Error (' + ee.name + '):\n' + ee.message); }
throw ee;
}
}
@ -113,7 +118,6 @@ export default class OutlookMeetingNotes extends Plugin {
else {
// One file was dropped, hand it over to createMeetingNote
const droppedFile = droppedFiles[0];
new Notice('Dropped: ' + droppedFile.name);
const fr = new FileReader();
fr.onload = () => {

View file

@ -1,10 +1,10 @@
{
"id": "outlook-meeting-notes",
"name": "Outlook Meeting Notes",
"version": "0.1.1",
"minAppVersion": "0.15.0",
"version": "0.2.1",
"minAppVersion": "1.8.9",
"description": "Creates meeting notes for Outlook appointments and meetings.",
"author": "David Ingerslev",
"authorUrl": "https://github.com/davidingerslev",
"isDesktopOnly": false
}
}

1761
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "outlook-meeting-notes",
"version": "0.1.1",
"version": "0.2.1",
"description": "Creates meeting notes for Outlook appointments and meetings.",
"main": "main.js",
"scripts": {
@ -12,14 +12,16 @@
"author": "",
"license": "MIT",
"devDependencies": {
"@types/node": "^16.11.6",
"@typescript-eslint/eslint-plugin": "5.29.0",
"@typescript-eslint/parser": "5.29.0",
"builtin-modules": "3.3.0",
"esbuild": "0.17.3",
"@types/moment": "^2.11.29",
"@types/mustache": "^4.2.5",
"@types/node": "^22.13.10",
"@typescript-eslint/eslint-plugin": "8.26.1",
"@typescript-eslint/parser": "8.26.1",
"builtin-modules": "5.0.0",
"esbuild": "0.25.1",
"obsidian": "latest",
"tslib": "2.4.0",
"typescript": "4.7.4"
"tslib": "2.8.1",
"typescript": "5.8.2"
},
"dependencies": {
"@kenjiuno/msgreader": "^1.22.0",

View file

@ -8,6 +8,7 @@
"allowJs": true,
"noImplicitAny": true,
"moduleResolution": "node",
"esModuleInterop": true,
"importHelpers": true,
"isolatedModules": true,
"strictNullChecks": true,

View file

@ -1,3 +1,10 @@
{
"0.1.1": "0.15.0"
}
"0.1.1": "0.15.0",
"0.1.2": "0.15.0",
"0.1.3": "0.15.0",
"0.1.4": "1.8.9",
"0.1.5": "1.8.9",
"0.1.6": "1.8.9",
"0.2.0": "1.8.9",
"0.2.1": "1.8.9"
}