QOwnNotes/doc/scripting
2016-05-14 07:19:46 +02:00
..
absolute-media-links.qml added a new script function insertingFromMimeDataHook and renamed function modifyMediaMarkdown to insertMediaHook 2016-05-12 18:50:18 +02:00
example.qml improved the script 2016-05-12 19:13:02 +02:00
execute-command-after-note-update.qml added more information 2016-05-14 07:19:46 +02:00
note-text-from-5pm-mail.qml generalized a statement 2016-05-13 07:47:49 +02:00
README.md Update README.md 2016-05-14 07:17:55 +02:00

QOwnNotes Scripting

  • you may need to restart QOwnNotes to let changes in a script take action
  • if you need access to a certain functionality in QOwnNotes or have questions or ideas please open an issue on the QOwnNotes issue page
  • since debug output is disabled in the releases of QOwnNotes you might want to use console.warn() instead of console.log() to actually see an output
    • additionally you need to run QOwnNotes from the command line to see the outputs on the command line

Methods and objects QOwnNotes provides

Starting an external program in the background

Parameters

/**
 * QML wrapper to start a detached process
 *
 * @param executablePath the path of the executable
 * @param parameters a list of parameter strings
 * @return true on success, false otherwise
 */
bool startDetachedProcess(QString executablePath, QStringList parameters);

Usage in QML

script.startDetachedProcess("/path/to/my/program", ["my parameter"]);

Getting the path of the current note folder

Parameters

/**
 * QML wrapper to get the current note folder path
 *
 * @return the path of the current note folder
 */
QString currentNoteFolderPath();

Usage in QML

var path = script.currentNoteFolderPath();