Skip to content

Conversation

@Glin76
Copy link
Contributor

@Glin76 Glin76 commented Jun 8, 2025

Hello,

Here's a submission for a new script.

Hoping you'll find it useful

@pbek pbek merged commit db593d1 into qownnotes:master Jun 9, 2025
1 check passed
@pbek
Copy link
Member

pbek commented Jun 9, 2025

I tried your script.

  1. select text asdasd (note: there is no such note name)
  2. Use your custom action
  3. get warning [warning] file:///home/omega/Code/_internal/qownnotes-scripts/text2link/text2link.qml:28: TypeError: Cannot read property 'noteText' of null and no visible other result

@pbek
Copy link
Member

pbek commented Jun 9, 2025

Also, the name of the script text2link is misleading, since it doesn't convert a text to a link, it creates a link "somewhere" in the note and leaves the selected text intact.

pbek added a commit to pbek/QOwnNotes that referenced this pull request Jun 9, 2025
…ToNoteId

Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
pbek added a commit to pbek/QOwnNotes that referenced this pull request Jun 9, 2025
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
@pbek
Copy link
Member

pbek commented Jun 9, 2025

25.6.1

  • There now is a new scripting method note.getNoteUrlForLinkingToNoteId to return
    the Markdown note URL for linking to a note (for #268)

I updated your script to use this method.

@Glin76
Copy link
Contributor Author

Glin76 commented Jun 9, 2025

get warning [warning] file:///home/omega/Code/_internal/qownnotes-scripts/text2link/text2link.qml:28: TypeError: Cannot read property 'noteText' of null and no visible other result

I cannot reproduce this message.
And this error seems weird because 'noteText' is only use in the loop of fetchNoteIdsByNoteTextPart

@Glin76
Copy link
Contributor Author

Glin76 commented Jun 9, 2025

I updated your script to use this method.

Thank you very much for updating the API, and the script

@Glin76
Copy link
Contributor Author

Glin76 commented Jun 9, 2025

the name of the script text2link is misleading

You're totally right. I was in the same logic than the text2tag script, but it's not the same.
Do you have an idea of name ?
TextLinkNotes ?

@pbek
Copy link
Member

pbek commented Jun 9, 2025

I'd feed an llm the description of the script and ask for a proper name 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants