Skip to content

Commit 509dda7

Browse files
committed
+ script: add-multiple-tags/add-multiple-tags.qml
1 parent ac5a0dc commit 509dda7

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import QtQml 2.0
2+
3+
/**
4+
* This script creates a menu item and a button with which you can add space separated tags to the current note
5+
*/
6+
QtObject {
7+
/**
8+
* Initializes the custom action
9+
*/
10+
function init() {
11+
// create the menu entry
12+
script.registerCustomAction("addMultipleTags", "Add Multiple tags", "fav", "bookmark-new");
13+
}
14+
15+
/**
16+
* This function is invoked when a custom action is triggered
17+
* in the menu or via button
18+
*
19+
* @param identifier string the identifier defined in registerCustomAction
20+
*/
21+
function customActionInvoked(identifier) {
22+
switch (identifier) {
23+
// add tags to the current note
24+
case "addMultipleTags":
25+
var tags = script.inputDialogGetText("Add tags", "Enter tags separated by space", "");
26+
script.log(tags);
27+
var tagsList = tags.split(' ');
28+
var i;
29+
for (i = 0; i < tagsList.length; i++) {
30+
script.tagCurrentNote(tagsList[i]);
31+
}
32+
break;
33+
}
34+
}
35+
}

add-multiple-tags/info.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "Add Multiple tags",
3+
"identifier": "add-multiple-tags",
4+
"script": "add-multiple-tags.qml",
5+
"authors": ["@Flashwalker"],
6+
"platforms": ["linux", "macos", "windows"],
7+
"version": "0.0.1",
8+
"minAppVersion": "17.06.2",
9+
"description" : "This script creates a menu item and a button with which you can add space separated tags to the current note."
10+
}

0 commit comments

Comments
 (0)