Libki / libki-client

Libki Client
GNU General Public License v3.0
32 stars 17 forks source link

Save Username (Barcode) on Local Machine #115

Closed l0chte closed 2 months ago

l0chte commented 2 months ago

We use Envisionware's LPTOne for print management. When printing, a dialog box opens asking for the patron's barcode number. I would like to create a way to input this (using Auto Hot Key) based on the currently logged in Libki user. Is there a way to save the username to the local computer when logging in?

kylemhall commented 2 months ago

You can do this already! In %APPDATA%/Libki you will find the file Libki Kiosk Management System.ini. When a user is logged in, this file will have the key LoggedInUser under the section session. I think it should be fairly easy for you to extract the username/cardnumber from this file using AutoHotKey!

l0chte commented 2 months ago

Amazing!

l0chte commented 2 months ago

Thanks again!

Using AHK v1:

`

SingleInstance Force

DetectHiddenText, on DetectHiddenWindows, on SetTitleMatchMode, 3

Sleep, 2000

Loop { WinWait, User Identification, WinActivate sleep, 100 IniRead, LoggedInUser, %appdata%\Libki\Libki Kiosk Management System.ini, session, LoggedInUser ; Check if loggedInUser is not empty if (LoggedInUser != "") { Send, %LoggedInUser% sendinput, {Enter} } else { ; If loggedInUser is empty or the key doesn't exist, display an error message MsgBox, Unable to retrieve logged in user. } sleep, 5000 } `

kylemhall commented 2 months ago

@l0chte thanks for sharing you script!