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

32 lines
972 B
QML
Raw Normal View History

2018-05-17 15:02:13 +00:00
import QtQml 2.0
import QOwnNotesTypes 1.0
/**
* This script allows you to configure an external editor (or an other application) that should open
* a note when it is double clicked in the note list
*/
Script {
property string executablePath;
// register your settings variables so the user can set them in the script settings
property variant settingsVariables: [
{
"identifier": "executablePath",
"name": "Path of external editor",
"description": "Please select the path to the executable:",
"type": "file",
"default": "kate",
}
];
/**
* This function is called after a note was double clicked
*
* @param {NoteApi} note - the note object that was clicked
*/
function noteDoubleClickedHook(note) {
// start the editor with the note path as parameters
script.startDetachedProcess(executablePath, [note.fullNoteFilePath]);
}
}