1
0
Fork 0
mirror of https://github.com/marty-oehme/scripts.git synced 2024-12-22 16:08:09 +00:00

Add a setting to specify a folder where created

journal notes will be placed.

When a default folder is set, make sure to search in that folder.
This has the highest chance of finding an existing journal note.
Right now we can not search the whole database for a note with this
name / filename.

Refs pbek/QOwnNotes#795
This commit is contained in:
Sander Boom 2017-11-30 17:22:48 +01:00
parent 87af56999b
commit 961b5f011a
2 changed files with 12 additions and 1 deletions

View file

@ -2,7 +2,7 @@
"name": "Journal entry", "name": "Journal entry",
"identifier": "journal-entry", "identifier": "journal-entry",
"script": "journal-entry.qml", "script": "journal-entry.qml",
"version": "1.1.0", "version": "1.1.1",
"minAppVersion": "17.11.6", "minAppVersion": "17.11.6",
"authors": ["@pbek", "@sanderboom"], "authors": ["@pbek", "@sanderboom"],
"description" : "This script creates a menu item and a button to create or jump to the current date's journal entry." "description" : "This script creates a menu item and a button to create or jump to the current date's journal entry."

View file

@ -48,6 +48,17 @@ QtObject {
var headline = "Journal " + m.getFullYear() + ("0" + (m.getMonth()+1)).slice(-2) + ("0" + m.getDate()).slice(-2); var headline = "Journal " + m.getFullYear() + ("0" + (m.getMonth()+1)).slice(-2) + ("0" + m.getDate()).slice(-2);
var fileName = headline + ".md"; var fileName = headline + ".md";
// Check if we already have a Journal note for today.
// When a default folder is set, make sure to search in that folder.
// This has the highest chance of finding an existing journal note.
// Right now we can not search the whole database for a note with this
// name / filename.
if (defaultFolder && defaultFolder !== '') {
script.jumpToNoteSubFolder(defaultFolder);
}
var note = script.fetchNoteByFileName(fileName); var note = script.fetchNoteByFileName(fileName);
// check if note was found // check if note was found