Jump to content

Recommended Posts

Posted

I've been using Auto-it3 and Scite for about two weeks now (XP/sp2), and have had a lot of fun making scripts for some of my programs that already have silent switches--just to do it. I made one for Cryptoexpert 2005 PE last night (which works fine in Vm, and real world), and encountered an oddity that perhaps someone could explain. Part of the registration process asks for the path to the "license.key" which resides in the Crypto setup folder--below is a portion--notice in the pathway (C:\Install\Cryptoexpert\liccense.key) how I have two "c's" in license? For some odd reason, and during the execution of the script, "something" clicks behind the "c" and backspaces it, which effectively mispells the path. I then put two "c's"--one gets backspaced, leaving "license" spelled right. The script runs fine--I was just curious about what would make it backspace a "c". Thanks. :)

WinWait("CryptoExpert 2005 PE")

If Not WinActive("CryptoExpert 2005 PE") Then WinActivate("CryptoExpert 2005 PE")

ControlClick("CryptoExpert 2005 PE" ,"Unlock" ,"Button4" ,2)

Sleep(1000)

WinWait("Registration","License file locatio")

If Not WinActive("Registration","License file locatio") Then WinActivate("Registration","License file locatio")

WinWaitActive("Registration","License file locatio")

Send("C:\Install\Cryptoexpert\liccense.key")

MouseMove(312,59)

MouseDown("left")

MouseUp("left")

CryptoExpert.au3


Posted

I see 2 c's in each Send. Indeed an odd behaviour with that installer. Some installers tend to show some wierdness in response.

Test script used:

For $i = 1 To 10
$pid = Run('notepad')
WinWaitActive('Untitled')
For $j = 1 To 10
Send("C:\Install\Cryptoexpert\liccense.key")
Send('{ENTER}')
Next
ProcessClose($pid)
Next

You could try ControlSend or ControlSetText ?

Posted

I originally used Scite Scriptwriter for Crypto, but it didn't run the program properly later. (This has happened with another pg too). In the other case, the program's unlock key was all big caps--when I ran the script later, 80% of the letters got reduced to small cap, which gave an "invalid key" response. I deleted the line created by Scriptwriter, and typed it in straight--that worked fine. This has ocurred with both Scite 3.1.1.0 and 3.1.1.8 beta. I've found that sometimes a "ControlClick" had to be replaced with a "MouseMove", or "("{TAB}")" to make things work right. That doesn't seem right somehow, but I've only been tinkering with Auto-it and Scite for a couple weeks. (Auto-it noob :whistle: ) I haven't tried ControlSend or ControlSetText yet.

Posted

Yeh, I could see you used ScriptWriter. Try AutoMacroGenerator also.

When you have finished playing with Send and MouseClick, then you can progress to the more reliable Control* functions.

The Latest AutoIt Beta, released today is 3.1.1.93. If ControlSend or ControlSetText do not work, and since you mentioned beta, then you could test my Wsh Sendkeys UDF ?

Run('notepad')
WinWait('Untitled')
_WshSend('Untitled', 'abcDEF')

; Usage _WshSend ( "title", "text to send" )
Func _WshSend($title, $string)
$WshShell = ObjCreate("WScript.Shell")
If Not @error Then
$WshShell.AppActivate( WinGetTitle($title) )
$WshShell.SendKeys($string)
$WshShell = ''
Return True
EndIf
EndFunc

It may send better then Send. Have not had a reason to use it yet.

Posted

Hmmm. I tried ConrolSetText, and ControlSend. In both cases, the "c" gets backspaced, leaving "liense.key"

Putting two "c's" in license isn't a biggie, as the script runs fine with them--but I'd still like to know what's causing the backspace of letters, or letters to switch from big to small cap.

Posted

There is another that i do not use much at all.

ControlCommand('title', 'text', 'classnamenn', "EditPaste", 'string')

Hmm, Pushing you some code for a 2 week old AutoIt user. ControlCommand does some numerous tricks. This is it's EditPaste function to try.

Posted

@MHz..I tried your WshSend script. (Thanks). The script ran fine--but the "c" still gets backspaced. Something glitchy somewhere. I'm going to dl the latest Auto-it beta, and also check out AutoMacroGen.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...