QOwnNotes/doc/scripting/execute-command-after-note-update.qml

22 lines
683 B
QML
Raw Normal View History

2016-05-12 11:44:29 +02:00
import QtQml 2.0
/**
* This script will execute an external program every time a note was written to the disk
*/
QtObject {
/**
* This function is called when a note gets stored to disk
*
* @param fileName string the file path of the note
* @param noteText string the note text
*/
function onNoteStored(fileName, noteText) {
// execute an external program
// try not to alter the note file or QOwnNotes will try to update
// the file every time you change the note
script.startDetachedProcess("/path/to/my/program", [fileName]);
console.log("program was executed for file: " + fileName);
}
}