From ba8cff40436bf44a60ec9972a6fb251aa2d731c7 Mon Sep 17 00:00:00 2001 From: Glin76 Date: Wed, 4 Jun 2025 20:49:57 +0200 Subject: [PATCH 1/5] Add files via upload --- text2tag/text2tag.json | 16 ++++++++++++++++ text2tag/text2tag.qml | 29 +++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 text2tag/text2tag.json create mode 100644 text2tag/text2tag.qml diff --git a/text2tag/text2tag.json b/text2tag/text2tag.json new file mode 100644 index 0000000..29d170c --- /dev/null +++ b/text2tag/text2tag.json @@ -0,0 +1,16 @@ +{ + "name": "Text2tag", + "identifier": "Text2tag", + "script": "Text2tag.qml", + "authors": [ + "@Glin76" + ], + "platforms": [ + "linux", + "macos", + "windows" + ], + "version": "0.0.1", + "minAppVersion": "25.05.3", + "description": "This script creates a menu item and a button that adds a tag with the selected text to the current note" +} \ No newline at end of file diff --git a/text2tag/text2tag.qml b/text2tag/text2tag.qml new file mode 100644 index 0000000..09a89a3 --- /dev/null +++ b/text2tag/text2tag.qml @@ -0,0 +1,29 @@ +import QtQml 2.0 + +/** + * This script creates a menu item and a button that adds a tag with the selected text to the current note + */ +QtObject { + + function init() { + // create the menu entry + script.registerCustomAction("Text2tag", "Create tag with selected text", "Text 2 tag", "bookmark-new"); + } + + function customActionInvoked(identifier) { + switch (identifier) { + case "Text2tag": + var tag = script.getTagByNameBreadcrumbList(script.noteTextEditSelectedText()); + var AlreadyTagged = false; + for (var idx in tag.notes) { + if (tag.notes[idx].id == script.currentNote().id) { + AlreadyTagged = true; + } + } + if (!AlreadyTagged) { + script.tagCurrentNote(script.noteTextEditSelectedText()); + } + break; + } + } +} From 25be15b7099c4a0fc4e340c46e220748807fcea1 Mon Sep 17 00:00:00 2001 From: Glin76 Date: Wed, 4 Jun 2025 21:06:04 +0200 Subject: [PATCH 2/5] new JSON file --- text2tag/info.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 text2tag/info.json diff --git a/text2tag/info.json b/text2tag/info.json new file mode 100644 index 0000000..d034dfe --- /dev/null +++ b/text2tag/info.json @@ -0,0 +1,16 @@ +{ + "name": "Text2tag", + "identifier": "text2tag", + "script": "text2tag.qml", + "authors": [ + "@Glin76" + ], + "platforms": [ + "linux", + "macos", + "windows" + ], + "version": "0.0.1", + "minAppVersion": "25.05.3", + "description": "This script creates a menu item and a button that adds a tag with the selected text to the current note." +} \ No newline at end of file From 3d4cf18bb430f1f9395c2fa287232361b091c107 Mon Sep 17 00:00:00 2001 From: Glin76 Date: Wed, 4 Jun 2025 21:06:44 +0200 Subject: [PATCH 3/5] Delete text2tag/text2tag.json --- text2tag/text2tag.json | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 text2tag/text2tag.json diff --git a/text2tag/text2tag.json b/text2tag/text2tag.json deleted file mode 100644 index 29d170c..0000000 --- a/text2tag/text2tag.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "Text2tag", - "identifier": "Text2tag", - "script": "Text2tag.qml", - "authors": [ - "@Glin76" - ], - "platforms": [ - "linux", - "macos", - "windows" - ], - "version": "0.0.1", - "minAppVersion": "25.05.3", - "description": "This script creates a menu item and a button that adds a tag with the selected text to the current note" -} \ No newline at end of file From 3b34914dbd9e0504c54a9dc8e08feca7491b3a9a Mon Sep 17 00:00:00 2001 From: Glin76 Date: Thu, 5 Jun 2025 07:52:22 +0200 Subject: [PATCH 4/5] Delete text2tag/text2tag.qml --- text2tag/text2tag.qml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 text2tag/text2tag.qml diff --git a/text2tag/text2tag.qml b/text2tag/text2tag.qml deleted file mode 100644 index 09a89a3..0000000 --- a/text2tag/text2tag.qml +++ /dev/null @@ -1,29 +0,0 @@ -import QtQml 2.0 - -/** - * This script creates a menu item and a button that adds a tag with the selected text to the current note - */ -QtObject { - - function init() { - // create the menu entry - script.registerCustomAction("Text2tag", "Create tag with selected text", "Text 2 tag", "bookmark-new"); - } - - function customActionInvoked(identifier) { - switch (identifier) { - case "Text2tag": - var tag = script.getTagByNameBreadcrumbList(script.noteTextEditSelectedText()); - var AlreadyTagged = false; - for (var idx in tag.notes) { - if (tag.notes[idx].id == script.currentNote().id) { - AlreadyTagged = true; - } - } - if (!AlreadyTagged) { - script.tagCurrentNote(script.noteTextEditSelectedText()); - } - break; - } - } -} From 41222e0e1db412636082a45c2afb9ab100f486f8 Mon Sep 17 00:00:00 2001 From: Glin76 Date: Thu, 5 Jun 2025 07:53:09 +0200 Subject: [PATCH 5/5] correction of text2tag.qml --- text2tag/text2tag.qml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 text2tag/text2tag.qml diff --git a/text2tag/text2tag.qml b/text2tag/text2tag.qml new file mode 100644 index 0000000..25dcf54 --- /dev/null +++ b/text2tag/text2tag.qml @@ -0,0 +1,29 @@ +import QtQml 2.0 + +/** + * This script creates a menu item and a button that adds a tag with the selected text to the current note + */ +QtObject { + + function init() { + // create the menu entry + script.registerCustomAction("Text2tag", "Create tag with selected text", "Text 2 tag", "bookmark-new", true, false, true); + } + + function customActionInvoked(identifier) { + switch (identifier) { + case "Text2tag": + var tag = script.getTagByNameBreadcrumbList(script.noteTextEditSelectedText()); + var AlreadyTagged = false; + for (var idx in tag.notes) { + if (tag.notes[idx].id == script.currentNote().id) { + AlreadyTagged = true; + } + } + if (!AlreadyTagged) { + script.tagCurrentNote(script.noteTextEditSelectedText()); + } + break; + } + } +}