mirror of
https://github.com/pbek/QOwnNotes.git
synced 2025-06-29 05:19:55 +00:00
22 lines
683 B
QML
22 lines
683 B
QML
|
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);
|
||
|
}
|
||
|
}
|