Difficulties with clipboard monitor

13 views
Skip to first unread message

David Fisher

unread,
Sep 15, 2020, 6:08:44 PM9/15/20
to Notecase Pro
Trying to use the clipboard monitor/manager feature and I'm not getting it.

Basically I want anything I copy in a db to go into a certain note. I have Clipboard Monitor turned on in Tools. From what I've read in the Help file it looks like that should be all I need to do - when I switch it on I get the message "text will now be pasted into (root note)". But what exactly is "root note"? I don't see any such thing in the db. There's no single root note as far as I can see, just a set of sibling items.

So I then specify further, and in Settings I say which db and which note I want the copied text to go into, and to store all text in that note. But when I copy text, nothing appears in that item.

Is there something I'm missing?

-- David F.

Paul Merrell

unread,
Sep 15, 2020, 6:12:50 PM9/15/20
to Notecase Pro
If I recall correctly, the feature only works with clips from other programs.

Miro will correct me if I'm wrong.

If you want, I could whip out a script that would do what you want,
although you'd have to run the script after using the clipboard
instead of doing a paste operation.

Best regards,

Paul
--
[Notice not included in the above original message: The U.S. National
Security Agency neither confirms nor denies that it intercepted this
message.]
¯\_(ツ)_/¯

David Fisher

unread,
Sep 15, 2020, 6:30:32 PM9/15/20
to Notecase Pro
Yes that was actually a thought that I had - that it only applied to external programmes. I guess I just ignored that thought...  by all means put together a script if it's not too much trouble, though I feel I am monopolising your script writing services right now! Personally I would find that "gathering" function via the clipboard incredibly useful, from within NCP as well as from outside it. Putting together little collections of what I would then turn into tags or other notes.

cheers

David F.

Paul Merrell

unread,
Sep 15, 2020, 7:22:15 PM9/15/20
to Notecase Pro
On Tue, Sep 15, 2020 at 3:30 PM 'David Fisher' via Notecase Pro
<noteca...@googlegroups.com> wrote:
>
> Yes that was actually a thought that I had - that it only applied to external programmes. I guess I just ignored that thought... by all means put together a script if it's not too much trouble, though I feel I am monopolising your script writing services right now! Personally I would find that "gathering" function via the clipboard incredibly useful, from within NCP as well as from outside it. Putting together little collections of what I would then turn into tags or other notes.

I was wrong. We have an After Content Copied script event trigger so
you wouldn't have to manually run the script; it would just fire
automatically after content is copied within any note pane.

Would you like a visible divider between clips, e.g.,

[blank line]
* * * *
[blank line]

? If so, what would you like for a divider?


Playing with the concept a little: Would you want these clips to go
into the same note that the Clipboard Monitor uses as its datastore
when it's set to store all clips in the single note? Or a different
note?

If the former, we could evolve this script into something that doesn't
require any manual editing of the script if Miro might give us:

int string Nc_Config_ClipboardMonitor_GetTarget()

that returns the DocID and Note ID for the program's clipboard monitor
target note (nil if no note is set).

David Fisher

unread,
Sep 15, 2020, 8:22:23 PM9/15/20
to Notecase Pro
Paul, I would be happy with simplicity at the moment. I.e. just use the same destination the user has set for the Clipboard Monitor. I think I would prefer to have no divider lines. Just a plain list of text items that I could then send off to be new notes or tags or whatever. Essentially the same as what you would end up with if copying from an external application.

I have started looking at scripting in NCP and am very taken with what I see. The interface makes it easy to "grab" scripts and make them available. I think this kind of "macro writing" approach is a very good fit for this type of programme. Looking forward to developing some scripts of my own - there seem to be plenty of examples to work from.

cheers and thanks

David F.

Paul Merrell

unread,
Sep 15, 2020, 9:50:07 PM9/15/20
to Notecase Pro
On Tue, Sep 15, 2020 at 5:22 PM 'David Fisher' via Notecase Pro
<noteca...@googlegroups.com> wrote:
>
> Paul, I would be happy with simplicity at the moment. I.e. just use the same destination the user has set for the Clipboard Monitor. I think I would prefer to have no divider lines. Just a plain list of text items that I could then send off to be new notes or tags or whatever. Essentially the same as what you would end up with if copying from an external application.

As I recall, that throws a blank line between clips.

> I have started looking at scripting in NCP and am very taken with what I see. The interface makes it easy to "grab" scripts and make them available. I think this kind of "macro writing" approach is a very good fit for this type of programme. Looking forward to developing some scripts of my own - there seem to be plenty of examples to work from.

Great!

I've become quite enthused with extending NC Pro with Lua scripts. The
possibilities seem nearly boundless. I never tried programming before
I began with Lua and NC Pro but have found it surprisingly easy (a few
debugging sessions excluded).

If you want to experiment with scripting the program, I suggest
installing Daniel's Plugin Developer Tools plugin. It has quite a few
scripting aid scripts. You'll find many more in my Cornucopia Script
collection (and oodles of useful functions you can copy and paste)
downloadable from
<https://sites.google.com/site/marbux/home/cornucopia-scripts>. That's
a work in progress. Scripts that have an "x" prepended to their titles
are not working yet. Bug reports on any of the others will be
appreciated.

A couple of gotcha's to watch out for:

1. Character formats: Lua wants nothing but ASCII, NC Pro wants
nothing but UTF-8. Use the embedded utf8 library in place of the
corresponding Lua string functions. See Help file > Automation,
Scripts and Plugins > Scripting NoteCase Pro > Integrated Lua
Libraries > Lua-utf8 > Routines Substituting for Lua Routines

2. Character counts: Because it's built atop the GTK programmer's
library, NC Pro begins its string character counts at 1. The embedded
utf-8 library, like Lua, begins its character counts at 0. The math
isn't difficult; remembering which is which during those long periods
between running into this problem is another story (at least for me
:-).

Best regards,

Paul

By the way, I've just finished debugging one of them that belongs with
the scripts I sent earlier, Delete All Descendants (without deleting
the current note). So the updated Tree Actions collection is attached.
Tmp.ncdb

Paul Merrell

unread,
Sep 16, 2020, 8:17:39 AM9/16/20
to Notecase Pro
David, I live with my family in Springfield, Oregon about 2 miles from
a fire evacuation zone. That has complicated my life. :-)

Because there are a lot of unforeseen interruptions, I don't know when
I will be able to finish your script, although I hope I can get it
done tomorrow or the next day. In the meantime, I attach a couple of
scripts that should work around some of your issues. One is Append
Clip to Clipboard. The other is Clear Clipboard or Append Link to
Clipboard. The first allows you to assemble a bunch of clips in the
clipboard. The other lets you do the same with links to notes.

Best regards,

Paul
Tmp.ncdb

David Fisher

unread,
Sep 16, 2020, 10:15:56 AM9/16/20
to Notecase Pro
Paul, what you have provided is great, something not complete but with the relevant bits as it were - it's more useful in a way, as I start working out what I can do with scripts. Thank you.

I just googled "oregon fire". My God it looks dreadful. Stay safe, and really, NCP scripting deservedly falls someway down the priority list.

David
Reply all
Reply to author
Forward
0 new messages