Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

i want to type a password to execute command

If you have a question or need help, this is the place to be.
Post Reply
bolets
Posts: 31
Joined: Wed Apr 04, 2007 2:38 pm

i want to type a password to execute command

Post by bolets »

i want to have a password field. when right password is typed the macro will begin. Anyone know if there is a plugin/script for this?
specter333
Experienced User
Posts: 95
Joined: Thu Dec 27, 2007 12:26 am

Re: i want to type a password to execute command

Post by specter333 »

This post is kinda old but if your still interested here is an idea for a workaround.

I use EG events to run applications for almost everything I do. I use a program called Auto Hot Keys to actually trigger my end events. Ie, for every thing I want to trigger I write a short script, convert it into an executable that EG runs. Say I want to turn my kitchen lights off, I press a button on a remote that triggers EG to open a program named kitchen lights off that sends the proper X10 command to the Activehome interface. I know EG would actually do all of this without the scripts but I already had them written and this was the easiest way to set things up.

Anyway, my thought was to make an Auto Hot Keys script for accepting your password then triggering your event if it's entered correctly. The scripts are easy to wright and this one should be very short. Simply open a dialog box with a user input field and an If/Else response to the input. The script could even trigger another macro in EG. You can download Auto Hot Keys from Download.com and it's free.

Hope this helps.
Rich
bolets
Posts: 31
Joined: Wed Apr 04, 2007 2:38 pm

Re: i want to type a password to execute command

Post by bolets »

dont think the post is old... just a couple of days.
Thanks for your answer but i dont wanna use/lern another program to make a password field to continue a task.
specter333
Experienced User
Posts: 95
Joined: Thu Dec 27, 2007 12:26 am

Re: i want to type a password to execute command

Post by specter333 »

Hi again, I know you weren't interested in this but I wanted to see if I could make this work and thought I'd share my findings.

I've attached a Autohotkeys script as well as the .exe file made from it. The script will open in notepad so you can see what it consist of, however you'll need to install Autohotkeys if you want to make any changes and convert it to an executable. The scripts themselves will run on your machine with it installed but I've had no luck getting EG to launch them so I convert them. The exe files will work on any machine with or without ahk installed. AHK can be downloaded here, http://www.download.com/AutoHotkey/3000 ... ?tag=lst-1
and it's free.

For testing I made a key combination in EG, Control and 1, that triggers a macro that runs password.exe which pop's up a dialog box asking for a password. If the password is entered incorrectly another dialog box pops up with the caps lock reminder, click ok and everything goes away and you start back at the beginning. If it is correct then the script sends another key combination back to EG which then runs VLC. Instead of a key combination any event EG can read and AHK can send could be used and instead of going back to EG it could open or trigger what ever event you want. An almost unlimited amount of passwords could be used if you have multiple users. I only used one in the script, alpha.

This method of course only password protects exiting the script itself. I won't keep what ever your trying to secure from starting up some other way.

If anyone would like changes made to the script to suit their purposes I'd be glad to help. Just leave a message or PM me.

Rich
Attachments
password.zip
(192.79 KiB) Downloaded 172 times
bolets
Posts: 31
Joined: Wed Apr 04, 2007 2:38 pm

Re: i want to type a password to execute command

Post by bolets »

looks interesting. could you please insert a xml file for me to test it?
stisev
Experienced User
Posts: 162
Joined: Tue Jun 26, 2007 2:55 am

Re: i want to type a password to execute command

Post by stisev »

I am also looking for something like this. If anyone has a pure EG solution, please speak up!: )
specter333
Experienced User
Posts: 95
Joined: Thu Dec 27, 2007 12:26 am

Re: i want to type a password to execute command

Post by specter333 »

I've attached a XLM file to test the password box. I've also attached an updated version of the AHK script. The old one displayed the "incorrect" message box when cancel was pressed except if the correct password was entered, then it proceeded as if OK was pressed. The new version simply exits if cancel is pressed under any conditions.

1. "CTRL 1", prompts EG to open the password box. Password is "alpha"
2. If password is correct, box sends key combination to EG.
3. EG is triggered by key combination and runs VLC media player.
4. If password is not correct, password box opens error message box.
5. Click "Ok" to exit error box or it times out in 15 seconds.

Of course any event you choose would trigger EG to open the password box.

The password box itself could start the program without going back to EG.

Password box could trigger EG with another type of trigger. I'm not sure what types of triggers can be sent from one windows program to another. Can anyone make a few suggestions?

As I said before I would be happy to modify the AHK script for anyone that would like the .exe file without having to install the software. It's nice to be able to help on this forum instead of always asking for it.

Enjoy
Rich
Attachments
password.zip
(192.79 KiB) Downloaded 171 times
passwordexample.xml
(767 Bytes) Downloaded 141 times
stisev
Experienced User
Posts: 162
Joined: Tue Jun 26, 2007 2:55 am

Re: i want to type a password to execute command

Post by stisev »

Hi Spect,

Why does the program return

[code
Keyboard.LWin
Keyboard.LAlt+LWin
Keyboard.LCtrl+LAlt+LWin
Keyboard.LShift+LCtrl+LAlt+LWin
Keyboard.LShift+LCtrl+LAlt+LWin+F
Keyboard.LShift+LCtrl+LAlt+LWin
Keyboard.LShift+LCtrl+LAlt
Keyboard.LShift+LCtrl
Keyboard.LShift
[/code]

instead of just "Keyboard.LShift+LCtrl+LAlt+LWin+F" that is needed?

Thanks!
specter333
Experienced User
Posts: 95
Joined: Thu Dec 27, 2007 12:26 am

Re: i want to type a password to execute command

Post by specter333 »

stisev wrote:Hi Spect,

Why does the program return

[code
Keyboard.LWin
Keyboard.LAlt+LWin
Keyboard.LCtrl+LAlt+LWin
Keyboard.LShift+LCtrl+LAlt+LWin
Keyboard.LShift+LCtrl+LAlt+LWin+F
Keyboard.LShift+LCtrl+LAlt+LWin
Keyboard.LShift+LCtrl+LAlt
Keyboard.LShift+LCtrl
Keyboard.LShift
[/code]

instead of just "Keyboard.LShift+LCtrl+LAlt+LWin+F" that is needed?

Thanks!
I'm not sure. Everything I've done so far with triggering from Auto Hot Keys with key presses is logged in EG like that. The code in AHK is "Send, ^!#+f" so I've always been puzzled why it's not just one event logged. It must be the way AHK sends the keystrokes.
specter333
Experienced User
Posts: 95
Joined: Thu Dec 27, 2007 12:26 am

Re: i want to type a password to execute command

Post by specter333 »

stisev wrote:Hi Spect,

Why does the program return

[code
Keyboard.LWin
Keyboard.LAlt+LWin
Keyboard.LCtrl+LAlt+LWin
Keyboard.LShift+LCtrl+LAlt+LWin
Keyboard.LShift+LCtrl+LAlt+LWin+F
Keyboard.LShift+LCtrl+LAlt+LWin
Keyboard.LShift+LCtrl+LAlt
Keyboard.LShift+LCtrl
Keyboard.LShift
[/code]

instead of just "Keyboard.LShift+LCtrl+LAlt+LWin+F" that is needed?

Thanks!
I just realized that when I physically push a key combination EG logs it the same way. So AHK is pressing keys just as if they were being typed on the keyboard.
stisev
Experienced User
Posts: 162
Joined: Tue Jun 26, 2007 2:55 am

Re: i want to type a password to execute command

Post by stisev »

Ahhh, lol.. :) Thanks
Post Reply