Nevermind.dk


Notes Client - sending crazy key combinations to interact with Windows


In my earlier blog entry I showed how to refresh the Notes Client UI with F5 sending key presses from code.

Using the same technic you can do some wild stuff, since you can almost simulate any keypress on the keyboard.



In an Action button you could for example:

- create email (CNTL + M)
- log out of Notes (CNTL +F5)
- lock Windows Windows key + L)
- show emoji bar (Windows key +.)
- show previews of open applications (Windows key + tab)
- print screen (ALT + PrnScr)

Also you could play back longer sequences of keypresses:

Robot robot = new Robot();
robot.setAutoDelay(500);
//WinKey + Q search
robot.keyPress(KeyEvent.VK_WINDOWS);
robot.keyPress(KeyEvent.VK_Q);
robot.keyRelease(KeyEvent.VK_WINDOWS);
robot.keyRelease(KeyEvent.VK_Q);

//C
robot.keyPress(KeyEvent.VK_C);
robot.keyRelease(KeyEvent.VK_C);

//m
robot.keyPress(KeyEvent.VK_M);
robot.keyRelease(KeyEvent.VK_M);
//d
robot.keyPress(KeyEvent.VK_D);
robot.keyRelease(KeyEvent.VK_D);
//enter
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
//D
robot.keyPress(KeyEvent.VK_D);
robot.keyRelease(KeyEvent.VK_D);
//I
robot.keyPress(KeyEvent.VK_I);
robot.keyRelease(KeyEvent.VK_I);
//R
robot.keyPress(KeyEvent.VK_R);
robot.keyRelease(KeyEvent.VK_R);
//enter
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);


try it ! :-)


This will go to Windows Search, and search for CMD, open the Command Prompt, and enter the DIR command.

So you are probably wondering ...can I also open it in Administrator mode and do "bad stuff"? :-)

No..., it seems the keyboard buffer is ignored .... fortunately :-)

(you do need to have a pause in between commands, 0,5 second is maybe a little long but you can better see what is going on then)

What about a scheduled agent in Domino?.....
Published by: Jesper B. Kiær at 27/03/2025 23.34.00 Full Post


F5 - UI refresh from code


In the Notes client you can refresh the UI by pressing the F5 (F9) button.

This means for a document the UI document gets recalulated and updated.


There are methods to something similar in code, UI.reload, UI.refresh etc,
In the backend document you can call doc.computewithform, but my experience is that with a complicated form with maybe both LotusScript and Formulas it will often fail.

Sometimes you just need a simple F5 refresh to update the document...because it works.

So here is a way to make a F5 refresh from LotusScript and Java.

Java:
System.setProperty("java.awt.AWTPermission", "createRobot");
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_F5);
robot.keyRelease(KeyEvent.VK_F5);

LotusScript:
Dim mySession As JAVASESSION
Dim Systemclass As JAVACLASS
Dim RobotClass As JAVACLASS
Dim robotObject As Javaobject
Set mySession = New JavaSession ()
Set SystemClass = mySession.GetClass("java.lang.System")
Set RobotClass = mySession.GetClass("java.awt.Robot")
Call SystemClass.setProperty("java.awt.AWTPermission", "createRobot")
Set robotObject = RobotClass.Createobject()
robotObject.keyPress(
116)
robotObject.keyRelease(
116)

You really do not need to call
System.setProperty("java.awt.AWTPermission", "createRobot");
to make the code work.
However for other Robot functionality, you will need it, so it is just show you how to
Published by: Jesper B. Kiær at 27/03/2025 14.40.00 Full Post


Notes 14 issues with Java and Locales


If you work in an International company you know all about the pain of different date, number etc formats around the world.



I have a CRM project at a customer where PDF invoices are created from Notes/Domino data. On each invoice the date and number formats are dependant on in which country the customer resides.

The invoices are created in Java and have been working great for a number of years.

Recently I have begun upgrading users to Notes 14. Then suddenly some users could no longer create the invoices for some countries, dates and numbers would be missing.

I could not exactly pinpoint where the issues were, but it had to do with Java Locales

After running up and down the Internet and looking everywhere....It got clearer to me things had changed after Java 8 (used in Notes 12), how locales are handled in Java.

It does not matter if your code is compiled to Java 8,it is a runtime issue.

It is described well here: https://incusdata.com/blog/locale-problems-upgrading-java8.

So there is a workaround how use the "old" way like in Java 8.

You need to add the parameter -Djava.locale.providers=COMPAT when the VM is run.

I was a little unsure how to do this in Notes, however Jesse Gallagher pointed to the use of a JavaOptions file.

In notes.ini add an entry JavaUserOptionsFile=Path/Filename pointing to a text file with the VM paramters

Lo and behold ..it worked and the invoice PDF creation is working again.


Links:

https://github.com/elastic/logstash/issues/12409
https://incusdata.com/blog/locale-problems-upgrading-java8
https://admincamp.de/customer/notesini.nsf/85255a87005060c585255a850068ca6f/2865a6a9b1bd5a7bc1257264004ff8ca?OpenDocument
Published by: Jesper B. Kiær at 07/10/2024 18.23.00 Full Post


HCL Notes-Domino mail routing issue, "No names found to send mail to"


There has been an email routing issue for years at a customer which I could not get my head around. Sometimes it seems someone would get the error for no apparent reason.

Today I might have circled in on what the issue is or rather what the bug in Notes/Domino is



I have tested and confirmed it on two different Domino 2 systems.

Scenario:

A = external mail user (MIME/SMTP)
B = internal mail user (Domino mail routing)
C = internal used mail-in database (does NOT have an internet Email address, only Notes/Domino address)

A sends email to B.
B receives the email over SMTP as an MIME email.
B forwards the email to C using Notes address.

The email does NOT get delivered to C.

The Notes client fails to lookup the correct internal Notes address, but instead tries to lookup the internet email address (which does not exist) and fails.
The email then gets stuck in users local Outbox with error "No names found to send mail to" and no recipients in the email.




 
(As a further issue the email in the local Outbox with no recipients will block and delay for further mail to be send from the user, to much annoyance for the user)  

If there are other internal recipients in the email in Sendto, CC  which do have an internet address, they will get the email.
Only the mail-in database with no internet address will NOT get the email.    
 
The correct routing would be to lookup the internal Notes address first for the Mail-in database and send the email to that address, before trying to send to Internet Email address..


(I have created a case at HCL)
Published by: Jesper B. Kiær at 27/08/2024 14.35.00 Full Post


Classic Domino and HTML 5


Sometimes a simple web application based on classic Domino is in place.


However Domino has not been updated in this area for many years.
If you create a form and use it on the web it will create a very old HTML document type.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

In 2024 you probably want to use HTML 5 and some of the newer features in it.

Fortunately you can change it to HTML 5.

Example:

Add a field, "Computed for display" type, named $$HTMLFrontMatter and set it to "<!DOCTYPE html>"

Here is simple example using HTML 5 features.



Adding the "required" property to the field for HTML 5 client validation



In browser this will show if you try to submit an empty field


Also you can see the HTML 5 feature of showing SVG graphics.


Note ... on Database properties you need to turn off "Use JavaScript when generating pages" to make validation work

Published by: Jesper B. Kiær at 28/05/2024 15.15.00 Full Post


The very useful little feature of a NotesItem


Sometimes there are these little things that you somehow do not notice ...until one day you do.

The thing I stumbled on, is that the NotesItem has a property called "SaveToDisk".


You can set whether a NotesItem should be saved to disk or not when a document is saved,
And that is really cool. Why ?
Because this a a great way to have temporary values and calculations on the document itself, when you are working with the document
and you do not have to worry about ever getting these values on the disk version of the document.
Published by: Jesper B. Kiær at 01/10/2023 22.57.00 Full Post

Read More