Feature Request: Password from file on startup

11 views
Skip to first unread message

jcor...@gmail.com

unread,
Sep 25, 2022, 9:48:01 AM9/25/22
to Notecase Pro
Hi Guys,

I'm looking for a way for Notecase to look in a file to retrieve a document's password on startup.  I'm running in Linux.  I know that there is a command line parameter to specify the password, but I don't want to expose it in 'ps' or have to purge it from my history if run by command line.

For example, if I script (in bash) Notecase to start with a document, I would like to have a command line parameter that tells Notecase to get the password from a specific file so I don't have to type it in when the document opens, and also, I don't want to specify it in the script for maintainability reasons, and also because I don't want anyone to see it when showing the command line for running processes.

Any thoughts?

Thanks,

John


Paul Merrell

unread,
Sep 25, 2022, 10:02:02 AM9/25/22
to Notecase Pro
John, I think you could achieve this with a Lua script launched by the After Application Started event trigger. See Help file > Automation, Scripts and Plugins > Scripting NoteCase Pro > Script Event Triggers > After Application Started. That trigger fires before any documents are loaded. 



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

jcor...@gmail.com

unread,
Sep 25, 2022, 10:55:20 AM9/25/22
to Notecase Pro
Thanks, Paul.  I'll take a look at it.  Also, is there a way to force Notecase to start as a new instance on startup if another instance is already running?

Paul Merrell

unread,
Sep 25, 2022, 10:59:41 AM9/25/22
to Notecase Pro
On Sun, Sep 25, 2022 at 7:55 AM jcor...@gmail.com <jcor...@gmail.com> wrote:
Thanks, Paul.  I'll take a look at it.  Also, is there a way to force Notecase to start as a new instance on startup if another instance is already running?

That's present default behavior, isn't it? 

Best regards,

Paul
 

Miroslav Rajcic

unread,
Sep 27, 2022, 9:20:06 AM9/27/22
to Notecase Pro
Hi John,

that's a good suggestion, I'll try to implement something in this cycle.

Regards,
  Miro

From: noteca...@googlegroups.com <noteca...@googlegroups.com> on behalf of jcor...@gmail.com <jcor...@gmail.com>
Sent: Sunday, September 25, 2022 3:48 PM
To: Notecase Pro <noteca...@googlegroups.com>
Subject: Feature Request: Password from file on startup
 
--
You received this message because you are subscribed to the Google Groups "Notecase Pro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to notecase-pro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/notecase-pro/2edacc5a-649e-4b5f-9383-2a9cb8204a9an%40googlegroups.com.

Miroslav Rajcic

unread,
Sep 27, 2022, 9:35:19 AM9/27/22
to Notecase Pro
The answer to this is more complex:
  • when you try to run the program with the single document parameter, program always tries to open a document in an existing instance
  • this is similar to the behavior of double-clicking the document file in file manager application (Windows Explorer for example)
  • in short idea behind this is: Notecase uses multiple document interface (MDI) model, so it is natural to use a single program instance to load multiple documents
Not sure how easy would it be to change things, because this code must support multiple inter-process communication APIs even on the same OS (DDE on Windows, libunique and GApp on Linux, MacIntegration on macOS, few others as well).

What would be your use case to force loading the document in the new instance?

Regards,
 Miro

Sent: Sunday, September 25, 2022 4:55 PM
To: Notecase Pro <noteca...@googlegroups.com>
Subject: Re: Feature Request: Password from file on startup
 
--
You received this message because you are subscribed to the Google Groups "Notecase Pro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to notecase-pro...@googlegroups.com.

John Cordone

unread,
Sep 27, 2022, 11:29:34 PM9/27/22
to Notecase Pro Google Groups
Hi Miro,

I will explain in steps.

1.  I have N documents in one instance of Notecase, each with a note that has many large embedded images, each on it's own line.  There is also text on it's own line under each image followed by a blank line.  Following this, there is another image on it's own line, followed by text on it's own line, and then a blank line.  This goes on for approximately 100 lines.

2.  I go to a specific line in each documents to add more data.  For example, the last line.

3.  When I get more data to add, it goes into only one of the documents, so I have to constantly switch between the documents.

4.  When I switch between documents, my edit cursor remains in the correct position, but the location of the view is not calculated correctly, so it is usually much higher up in the document.  As an example, if my edit cursor is on line 100, when I switch back, the view might be only on line 80 (for example).  I then need to use the scroll bar to move down to the bottom to see where I wanted to add the data.

If I enable multiple instances of Notecase, then I can open each document in a separate instance so I can switch between them without disturbing the view of where I am.  This makes this workflow easier.

I scripted (in Linux) the opening of these documents in Notecase, each in it's own instance.  This is done iteratively, so I put a small delay between the opening of each document to give me time to enter the password for that document.  This works on my main computer.  But I have a little (low power) laptop that I take with me.  On the little laptop, some documents open in their own instance while others bunch up into one instance.  On both computers, I have the Notecase single instance set to off, so there can be multiple instances.

There's probably a better workflow, but this is what has evolved.  ;)

At any rate, I don't know if my explanation is clear, but with this workflow, being able to open the files from password files, rather than embedding passwords in a script, or typing them in by hand, would be more convenient.

I'm not exactly sure why opening multiple instances works better on one computer and not fully on the other.  I might have a slightly older version of Notecase on my main computer and the newest version on the laptop.  I'll check on that.

As a side note, in this script, before I start opening Notecase instances, I replace the notecasepro.ini file with one with no recently opened documents set so Notecase won't re-open the documents it last used.

Let me know your thoughts on this,

John

Ps:  One other question, if I set LastPictureDoNotAskResize to 1 in the app (usually by accident), is there a way to undo this without stopping the app, editing the config file, and restarting?


You received this message because you are subscribed to a topic in the Google Groups "Notecase Pro" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/notecase-pro/mHH0iV-BImQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to notecase-pro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/notecase-pro/AM9P251MB0021FC74725662AF48D4F651B2559%40AM9P251MB0021.EURP251.PROD.OUTLOOK.COM.

Miroslav Rajcic

unread,
Oct 1, 2022, 1:32:21 AM10/1/22
to Notecase Pro Google Groups
Thanks John,

I'll try to add a command line flag to force loading in new instance.
Might need a help with testing 😉

Regards,
  Miro

From: noteca...@googlegroups.com <noteca...@googlegroups.com> on behalf of John Cordone <jcor...@gmail.com>
Sent: Wednesday, September 28, 2022 5:28 AM
To: Notecase Pro Google Groups <noteca...@googlegroups.com>

Miroslav Rajcic

unread,
Oct 1, 2022, 2:35:34 AM10/1/22
to Notecase Pro
Hi John,

I've implemented new "--password-file" parameter to load a password from the text file.
In case you have a Windows OS as well, the test Windows 64-bit (Ming64) build is available here:
https://notecase.sourceforge.net/temp/notecase_pro-4.6.6_mingw64_gtk3pre4.exe


If you need a Linux build, let me know what precise package you need.


Regards,

  Miro



Sent: Sunday, September 25, 2022 3:48 PM
To: Notecase Pro <noteca...@googlegroups.com>
Subject: Feature Request: Password from file on startup
 
--
You received this message because you are subscribed to the Google Groups "Notecase Pro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to notecase-pro...@googlegroups.com.

Paul Merrell

unread,
Oct 1, 2022, 4:57:37 AM10/1/22
to noteca...@googlegroups.com


On Fri, Sep 30, 2022 at 11:35 PM Miroslav Rajcic <mra...@hotmail.com> wrote:
Hi John,

I've implemented new "--password-file" parameter to load a password from the text file.
In case you have a Windows OS as well, the test Windows 64-bit (Ming64) build is available here:
Related questions for Help file:

1.  I'm assuming that this argument requires that  the document to open must be specified with the Open File on Program Launch argument, yes?

2. I'm also assuming that only one document  per launch can be opened with this argument, yes?

3. If so on 1. and 2., but multiple documents are specified with the  Open File on Program Launch argument, what happens?  

Best regards,

Paul

Miroslav Rajcic

unread,
Oct 1, 2022, 8:20:16 AM10/1/22
to noteca...@googlegroups.com
Hi Paul,

--password-file is complete equivalent to --password, just reading the data from file.
I.e. whatever we documented for --password should apply here as well.

Didn't test, but looking at the code, both should apply to multiple document paths passed through the command line.
For example, if you pass two .ncde (encrypted document) paths and one .ncdb (unencrypted), program should try to apply the password to both of the encrypted documents. If password is invalid for any of these documents, loading of that particular document will fail immediately (this is done to enable scripting, i.e. up to 3 times password entry popup will not be used here).

Regards,
  Miro


From: noteca...@googlegroups.com <noteca...@googlegroups.com> on behalf of Paul Merrell <mar...@gmail.com>
Sent: Saturday, October 1, 2022 10:57 AM
To: noteca...@googlegroups.com <noteca...@googlegroups.com>
Subject: Re: Feature Request: Password from file on startup
 
--
You received this message because you are subscribed to the Google Groups "Notecase Pro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to notecase-pro...@googlegroups.com.

John Cordone

unread,
Oct 1, 2022, 9:56:07 AM10/1/22
to noteca...@googlegroups.com
Thank you, Miro,

(Fortunately|Unfortunatly, take your pick) I do not run Windows for
myself, only Linux. I do use Windows for work, but it's on a locked
down computer. If you have a build for the latest Ubuntu release, I
can test it.

One other thing I just noticed. If I start Notecase and then try to
run a new instance from the menu, it starts the new instance, but I
get this pop-up message from the original instance:

Document file does not exist:
'/usr/bin/--noload'!

Let me know if it's only me seeing this issue.

Thanks,

John
> notecase-pro...@googlegroups.com<mailto:notecase-pro...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/notecase-pro/CAJ1g4g-FxRyvQw1PEutExMQW2qCBoK_p5rrkNLuVyRMuzrpw%2BA%40mail.gmail.com<https://groups.google.com/d/msgid/notecase-pro/CAJ1g4g-FxRyvQw1PEutExMQW2qCBoK_p5rrkNLuVyRMuzrpw%2BA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Notecase Pro" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/notecase-pro/mHH0iV-BImQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> notecase-pro...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/notecase-pro/DB9P251MB003285DDD27C0A2E3F353102B2599%40DB9P251MB0032.EURP251.PROD.OUTLOOK.COM.
>

Miroslav Rajcic

unread,
Oct 2, 2022, 7:21:31 AM10/2/22
to noteca...@googlegroups.com
Hi John,

assuming you've referred to Ubuntu 22.04 amd64 build, I created one here:

The new build:
  • implements "--password-file" parameter
  • implements "--new-instance" parameter to force opening the document in the new program instance
  • fixes the reported issue with "--noload" parameter (related to recent GApplication support in GTK3 builds)
Let me know how it works for you.

Regards,
  Miro

From: noteca...@googlegroups.com <noteca...@googlegroups.com> on behalf of John Cordone <jcor...@gmail.com>
Sent: Saturday, October 1, 2022 3:56 PM
To unsubscribe from this group and stop receiving emails from it, send an email to notecase-pro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/notecase-pro/CA%2BTGmb0JsAkYo%2BYwbqAXqHQ-1n%3DfM8Nx06qH8xcv%2BeKi47L9yw%40mail.gmail.com.

John Cordone

unread,
Oct 2, 2022, 10:14:44 AM10/2/22
to noteca...@googlegroups.com
Hi Miro,

In my initial testing, the --new-instance appears to be working.  :)

So far, I cannot get the --password-file feature to work.  :(

I'm assuming that it would be used like this:

--password-file "<path to password file>/<password file>" "<path to encrypted file>/<encrypted file>
Such that <password file> is a text file and <encrypted file> is a ncde file.

For example:
notecase --password-file "/home/user_name/password.txt" "/home/user_name/file.ncde"

If I am incorrect about the password file type, or how to specify the password file location, let me know.

Thanks,

John


Miroslav Rajcic

unread,
Oct 2, 2022, 3:06:17 PM10/2/22
to noteca...@googlegroups.com
Hi John,

the parameters you've posted seem to be correct, except that your example is missing the --new-instance part.
What is the exact issue reported when you run this?
Do you see anything helpful in the app logs?

I've tested on Linux and I had a problem that majority of text editors "insisted" in adding the new line character at the end of my password file contents, it would result in "Invalid password!" message on start.
Do you have similar issue? Just guessing, I don't see much data to give more meaningful comment 🙂

Regards,
  Miro


Sent: Sunday, October 2, 2022 4:14 PM
Reply all
Reply to author
Forward
0 new messages