Create note from highlighted text

There might be confusion as for "first line" of what isn't inserted.

This option works for such scenarios:
option checked, text highlighted:

1st line
2nd line

enter 1st line from popup into popup

new note will become:
title:
1st line from popup
body:

1st line
2nd line

when unchecked it will result in:
title:
1st line from popup
body:

1st line from popup

1st line
2nd line

I think that what you expect is that plugin should remove 1st line from body of the note.

Yes, that was my expectation - thanks for clarifying. Will play around a bit more with this plugin to see, how it fits my workflow.

It's doable. Quick question - would you like to have subnotebook in active notebook?
So for example you have note called "Science" in "My notes" notebook

  • My notes
    • "Science" note
  • Other notebook

and then

  • My notes
    • "Science" note
    • "Science" subnotebook with snippets from "Science" as separate notes

?

Hi @ambrt

I'd forgotten I wrote this! But yes, that might well work for me. I have made a few extracts from notes with this plugin and add the label "Extract" when I save them to make them more retrievable (though it hasn't been an issue yet as I haven't built up much of a collection of extracts).

But yes, to auto-generate a sub-notebook would be better organisation IMO. In one of my notebooks I have about a dozen extracts and they are already difficult to distinguish from the main notes without additional labelling (I add "extract" to the title to do that but since creation order is the default I have to sort the notes to group them).

Some thoughts:

Your suggested layout would work for me. Maybe, since a collection of extracts lives inside a particular notebook adding a prefix label to that sub-notebook such as "Extracts from [notebook name]: " would be helpful when searching, sorting or just visual scanning (and if that was also a database field it could be searchable by other plugins such as 'Note Overview' - which for me could be a very useful combination).

Presumably, the plugin would recognise that a general subnotebook for extracts already exists and push all extracts to the same location automatically.

Later, there might be a case for offering a user the opportunity to create own sub-notebook names but this might add mild complexity. I am thinking about the situation where there might be many extracts with slightly different themes in a notebook. But that can wait (I haven't hit that wall yet - nowhere near) and anyway, for me, this is manageable by tagging my extracts appropriately.

Grouping all extracts to a common sub-notebook is therefore a very useful first development.

:+1::thinking:

Cheers

Ok, so there's first working version of this in 1.5.0.

New option is called "Create subnotebooks for converted snippets based on title of origin note" and is turned off by default.

Here's how it works.

1 Like

That's looking pretty good BUT when I try it no sub-notebook is created ...

(1) select paragraph in note
(2) create/accept title
(3) extract added to same notebook as the original note ...

???

UPDATE: plugin changes the original note - encloses selection in square brackets and adds a link ref. I think I understand why but of course one would like to keep the original note unchanged ... (UPDATE 3: Weirdly I hadn't noticed this before! After thinking about it I could live with it ...)

UPDATE 2: updated this via Jopin. There have been issues with updating plugins (i.e. Note Overview plugin) - could htis explain unexpected behaviour?

Just checked on both development and real version of Joplin and they both do work.
To be sure, did you checked the option in settings?
Screenshot from 2021-04-21 22-49-31

Its turned off by default

Those things should be unrelated, but you might try to uninstall and install again (and check settings if option is checked).

If it still doesn't work it would be harder to tell what's going on.

1 Like

Aha! Once again, I missed the bleedin' obvious ... !

I looked but simply did not see the options down there at the bottom of the sidebar (I have a new much larger monitor ... that's my excuse anyway - bigger visual real estate and my eyes these days aren't up to it ...)

Anyway that's working fine - thanks. I'll use it for a bit and see how it works for me; if I have any suggestions I'll get back to you ...

Nice work, thanks. :+1: :grinning:

can this add text to an already existing file at the end or only copy it to a new note?

I hope the comment is not to noob like but... The name of the plugin in Plugins page of the Configuration screen is different from here. It is Convert Text To New Note instead of Create note from highlighted text. I thought it was not in plugins because I searched using the word create and did not found the plugin in the first place.

3 Likes

Hi there!

I recently upgraded Joplin to 2.2.7 (Win) and this plugin ( Convert Text To New Note v1.5.0) is not working: I do not see the icon nor the menu options.

Thanks for your help!

1 Like

Yes it's a bit irritating. I do a search for "Create" and can't find it

Hello. I can't seem to get the plugin to work in my case either.
Joplin 2.2.7 (prod, win32)

Client ID: 811bc84e99f24f7bb11705d17b24bc99
Sync Version: 2
Profile Version: 39
Keychain Supported: Yes

Revision: 6d1a2e2

Also, is there a way to get it to use existing highlights?

I too am unable to use this very useful plugin anymore. I think the problem with this plugin is probably related its being incompatible with the current API, i.e. it was probably written against the deprecated API. If that is true, I suspect that the plugin will not be usable by anyone who has a current version of Joplin until someone rewrites the plugin. That, sadly, is well beyond my ability.

See this discussion on this forum for more information on the API issue.

1 Like

I built a .jpl with the patch from this PR.

joplin.plugin.ambrt.convertToNewNote.jpl (11.5 KB)

5 Likes

It works perfect!!!

Thanks a lot...

It colud be great to find it in the plugins reppositories

This has to be done by the plugin dev. We do not have access to the dev's npm account.

Thanks for the new version. Now it works again...

Maarten

I notice that I am getting an error, plugin still is working though.

Logger.ts:219 08:10:17: models/Setting: Could not save settings Error: Error: SQLITE_CONSTRAINT: UNIQUE constraint failed: settings.key: INSERT INTO `settings` (`key`, `value`) VALUES (?, ?): plugin-joplin.plugin.ambrt.convertToNewNote.converTextToNewNoteSettingsNoteType,todo
    at DatabaseDriverNode.sqliteErrorToJsError (/Applications/Joplin.app/Contents/Resources/app.asar/node_modules/@joplin/lib/database-driver-node.js:23)
    at JoplinDatabase.sqliteErrorToJsError (database.ts:46)
    at JoplinDatabase.<anonymous> (database.ts:150)
    at Generator.throw (<anonymous>)
    at rejected (/Applications/Joplin.app/Contents/Resources/app.asar/node_modules/@joplin/lib/database.js:6)
    at processTicksAndRejections (internal/process/task_queues.js:95)

@ambrt are you still around? I am just wondering, because I've opened a pull request for this plugin and I haven't seen any posts from you lately on this forum.