mirror of
https://github.com/marty-oehme/scripts.git
synced 2024-12-21 23:48:08 +00:00
added script external-note-open
This commit is contained in:
parent
05292ad6fb
commit
704ed6eb6a
2 changed files with 41 additions and 0 deletions
31
external-note-open/external-note-open.qml
Normal file
31
external-note-open/external-note-open.qml
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
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]);
|
||||||
|
}
|
||||||
|
}
|
10
external-note-open/info.json
Normal file
10
external-note-open/info.json
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"name": "External note open",
|
||||||
|
"identifier": "external-note-open",
|
||||||
|
"script": "external-note-open.qml",
|
||||||
|
"authors": ["@pbek"],
|
||||||
|
"platforms": ["linux", "macos", "windows"],
|
||||||
|
"version": "1.0.0",
|
||||||
|
"minAppVersion": "18.05.4",
|
||||||
|
"description" : "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."
|
||||||
|
}
|
Loading…
Reference in a new issue