Jump to content

Recommended Posts

Posted

Hello people,

I have a problem with making the FreeOCR wizard unattended. so that's why i am asking for you help.

this is the code i am using (theoretically it should work but it doesn't).

Run("freeocr541.exe") 
WinWaitActive("Setup - FreeOCR") 
Send("!N") 
Send("!a")
Send("!N")
Send("!N")
Send("!I")

 

Hoping anyone can help me.

-Smolenaars

Posted

ow sorry, it starts without a problem but then doesnt go to the next wizard page.

 

i tested a sleep 10000 but that didnt change anything.

any ideas of how i could solve it.

Posted (edited)

I installed it on my vm win10. I'll take a look at it in a minute

 

Edit: Are you using the send command to install it? If so I think there's a better way.

Edited by aa2zz6
Posted

Thanks for the help but that didn't quite fix my problem.

the new problem is that it gives an error when i try to run it.

it also starts up the Setup twice.

 the script i am using is the following:

Run("freeocr541.exe")

Local $iPID = WinWait("[CLASS:TWizardForm]", "", 10)

ControlClick ($iPID "Setup - FreeOCR", "Welcome to the FreeOCR Setup Wizard", controlID [, button = "left" [, clicks = 1[, 260 [, 170]]]])

 

It gives the following error:

ControlClick ($iPID "Setup - FreeOCR", "Welcome to the FreeOCR Setup Wizard", controlID [, button = "left" [, clicks = 1[, 260 [, 170]]]]) ControlClick (^ERROR

Error: Error in expression.

  • Developers
Posted

Those [] shouldn't be in there and are just an indicator in the helpfile that these parameters are optional.
Have you tried building a sleep() between the send() commands to ensure you aren't sending them too fast?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

Removed the [] and inplemented the Sleep(), my problem is still the same though.

It still gives the same Error: Error in expression.

Any other ideas what might cause this?

Posted

Smolenaars,

Post the script that issues the error and the run log.

Are you using the full version of SCITE?

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Posted

I am using this script, it works with other setups but it doesn't work with the FreeOCR setup.

Run("freeocr541.exe")
WinWait("Setup - FreeOCR")
controlSend("Setup - FreeOCR", "", "[CLASS:TNewButton; INSTANCE:1]", "&Next >")

 

I also tried it with the controlclick but that didn't work just like this one doesn't.

  • Moderators
Posted

freeocr is very resistant to ControlClicks; I have run into it myself when packaging this application. Even though the controls show up on the Window Info Tool, you cannot interact with them. My suggestion would be either A: look at the IUIAutomation thread in the Examples forum, or B (more reliable): use Wix or some other open source tool to create an MSI from the installer, which you then can install silently.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted (edited)

Here you go buddy. Works on win7

Edit: The ID changes when the application is opened.. does someone know why the ID changes?

#RequireAdmin ; must include when installing

Example()

Func Example()

    Local $hWnd = WinWait("[CLASS:TWizardForm]", "", 10) ; use AutoIt v3 Window Info tool
    ; located in the AutoIt folder.

    WinActivate($hWnd) ; WinActivate sets Setup - FreeOCR as an active screen

    ;Notes:
    ;ControlClick("title", "text", controlID[, button = "left"[, clicks = 1[, x[, y]]]])
            ;  title =>> $hWnd = WinWait("[CLASS:TWizardForm]
            ; "text" =>> "&Next >"
            ; controlID =>> 329210

    ControlClick($hWnd, "&Next >", 329210) ;

EndFunc   ;==>Example

 

Process.png

Edited by aa2zz6
One last final thought :|

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...