mirror of
https://github.com/marty-oehme/scripts.git
synced 2024-12-21 15:38:09 +00:00
+ script: add-multiple-tags/add-multiple-tags.qml
This commit is contained in:
parent
ac5a0dc485
commit
509dda73ae
2 changed files with 45 additions and 0 deletions
35
add-multiple-tags/add-multiple-tags.qml
Normal file
35
add-multiple-tags/add-multiple-tags.qml
Normal file
|
@ -0,0 +1,35 @@
|
|||
import QtQml 2.0
|
||||
|
||||
/**
|
||||
* This script creates a menu item and a button with which you can add space separated tags to the current note
|
||||
*/
|
||||
QtObject {
|
||||
/**
|
||||
* Initializes the custom action
|
||||
*/
|
||||
function init() {
|
||||
// create the menu entry
|
||||
script.registerCustomAction("addMultipleTags", "Add Multiple tags", "fav", "bookmark-new");
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is invoked when a custom action is triggered
|
||||
* in the menu or via button
|
||||
*
|
||||
* @param identifier string the identifier defined in registerCustomAction
|
||||
*/
|
||||
function customActionInvoked(identifier) {
|
||||
switch (identifier) {
|
||||
// add tags to the current note
|
||||
case "addMultipleTags":
|
||||
var tags = script.inputDialogGetText("Add tags", "Enter tags separated by space", "");
|
||||
script.log(tags);
|
||||
var tagsList = tags.split(' ');
|
||||
var i;
|
||||
for (i = 0; i < tagsList.length; i++) {
|
||||
script.tagCurrentNote(tagsList[i]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
10
add-multiple-tags/info.json
Normal file
10
add-multiple-tags/info.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"name": "Add Multiple tags",
|
||||
"identifier": "add-multiple-tags",
|
||||
"script": "add-multiple-tags.qml",
|
||||
"authors": ["@Flashwalker"],
|
||||
"platforms": ["linux", "macos", "windows"],
|
||||
"version": "0.0.1",
|
||||
"minAppVersion": "17.06.2",
|
||||
"description" : "This script creates a menu item and a button with which you can add space separated tags to the current note."
|
||||
}
|
Loading…
Reference in a new issue