New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the ability to Star or Favourite notes #351

Closed
michael-rowe opened this Issue Oct 6, 2016 · 25 comments

Comments

Projects
None yet
3 participants
@michael-rowe

michael-rowe commented Oct 6, 2016

I've just imported all 800 of my notes from Evernote (thank you again for adding this feature) and now I'd like to add something like shortcuts to the notes that I use most often.

Evernote had a feature where you could Star notes, which added them to a list that is a bit like bookmarks for notes. I know that this would be possible to do now by tagging the note but I think it would be awesome if the toolbar had a Star icon that you could quickly use to mark a note as one that you want access to quickly.

The interface could work a bit like how Chrome bookmarks work. Just a thought...

@pbek pbek added the enhancement label Oct 6, 2016

@pbek

This comment has been minimized.

Owner

pbek commented Oct 6, 2016

Yes, there really are tags for that. Maybe it would be enough to implement a scripting-method where you can add a tag to the current note. Then you could create a custom action (as button in the toolbar, you also can add a keyboard shortcut to it) to add a "starred" tag.

How does that sound to you?

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented Oct 7, 2016

I add "!" to beginning of a note name, so it's always on top of the list. Pity it doesn't work for sub-folders since they show unsorted.

@michael-rowe

This comment has been minimized.

michael-rowe commented Oct 7, 2016

I think that I can make do with maboroshy's suggestion of renaming commonly used notes for now. If you want to add the scripting option to a to do list for later that would be cool, but not essential.

@pbek

This comment has been minimized.

Owner

pbek commented Oct 7, 2016

You would need to sort the notes alphabetically to make this work.

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented Oct 14, 2016

I'm not that clever when it comes to QML but what should I put to custom action script to rename a note?

@pbek

This comment has been minimized.

Owner

pbek commented Oct 14, 2016

What is it you are trying to achieve?

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented Oct 14, 2016

Custom action script to add star to a note name for Michael.

@pbek

This comment has been minimized.

Owner

pbek commented Oct 14, 2016

... by renaming the note? Don't you want to use a "star" tag?

@michael-rowe

This comment has been minimized.

michael-rowe commented Oct 14, 2016

I thought that it would add a "star" or "favourite" tag.

@pbek

This comment has been minimized.

Owner

pbek commented Oct 14, 2016

What are we currently talking about? :)

@michael-rowe

This comment has been minimized.

michael-rowe commented Oct 14, 2016

I was just saying that if you're going to make a script that does something to highlight a note as being important, it should add a tag to the note rather than rename it.

Or am I missing something?

@pbek

This comment has been minimized.

Owner

pbek commented Oct 14, 2016

Yes, a script that adds a tag was my suggestion. A command to add tags has still to be implemented.

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented Oct 14, 2016

Tagging is not a highlighting, it's putting note to kind of a list. I mean you can't quickly pick tagged note out of all notes list. But you can pick a specifically "renamed" one.

@pbek

This comment has been minimized.

Owner

pbek commented Oct 14, 2016

If you really want to go the renaming route...
https://github.com/pbek/QOwnNotes/tree/develop/doc/scripting
There is a command to get the current note and from that you can get it's path. And then you could call a linux command to rename the file. But I'm not sure if just renaming the note file will resolve your wishes...

@michael-rowe

This comment has been minimized.

michael-rowe commented Oct 14, 2016

I thought you would search for ”Starred" notes, which would filter the notes with that tag.

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented Oct 14, 2016

I knew about external command route but hoped to get cross-platform solution. But since Michael goes for tagging linux-only solution will do for me, it's even more favourable for me. I'll post here if I'd put anything up.

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented Oct 15, 2016

It took me quite a lot of time but I still haven't figured out how to pass multiple command arguments to script.startDetachedProcess.

I tried

var arguments = fullFileName + " " + newFileName;
script.startDetachedProcess("mv", [arguments]);
arguments: [fullFileName,newFileName];
script.startDetachedProcess("mv", [arguments]);

No avail.
Can't figure out correct syntax from your and QML docs.

@pbek

This comment has been minimized.

Owner

pbek commented Oct 15, 2016

What's about:

var arguments = [fullFileName, newFileName];
script.startDetachedProcess("/bin/mv", arguments);
@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented Oct 15, 2016

That did it! I'm still too dumb to understand why var is assigned as array but I can live with that.

However launching the script brings up "current note deleted" dialog which is immune to "don't track" options. I also have to manually refresh note list for new (renamed) note to appear. That's too much for one click action I wanted to make.

@pbek

This comment has been minimized.

Owner

pbek commented Oct 15, 2016

That did it! I still too dumb to understand why var is assigned as array but I can live with that.

the system command takes an array for the parameters and it makes it easier to escape certain parameters

immune to "don't track" options

if the current note is gone something has to happen :)

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented Oct 15, 2016

I understand about using array but I was surprised it's made by var. I thought it's a list thing in QML.

The logic is correct, but that means no mv in scripts. There's still handleNoteTextFileNameHook route left but it won't be as straightforward. I need to figure out how to force the hook activation with available script actions.

@pbek

This comment has been minimized.

Owner

pbek commented Oct 15, 2016

I understand about using array but I was surprised it's made by var. I thought it's a list thing in QML.

It's just JavaScript.

handleNoteTextFileNameHook

You cannot call a hook in a script. Unfortunately I've yet no idea what would make your endeavor easier without some major changes in QOwnNotes...

@Maboroshy

This comment has been minimized.

Contributor

Maboroshy commented Oct 15, 2016

I'll cease for renaming with "!' then. Ability to prepend note names with different markers with a single click looked promising though. At least I can use gained experience to pass current note file name to Bash-note.

@pbek

This comment has been minimized.

Owner

pbek commented Oct 16, 2016

16.10.5

  • added a new scripting method tagCurrentNote() to tag the current note
    • there is an example for creating a custom action to add a tag
      favorite to the current note at
      favorite-note.qml

@pbek pbek added this to the 16.10.5 milestone Oct 16, 2016

@pbek

This comment has been minimized.

Owner

pbek commented Oct 17, 2016

There now is a new release, could you please test it and report if the new features work for you?

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