Jump to content

Recommended Posts

Posted

Hi all!

I am all new to AutoIt and need a little help :)

My search in the forum and help file returned no solution.

Using ControlClick and "primary" or "main" returns error:

(The "primary" or "main" button will be the main click, whether or not the buttons are swapped.)

Code:

if WinExists("Tabular Editor -") = 0 Then ControlClick("FalconView", "",1617, "primary", 1, 15, 115)

Error

ERROR: ControlClick() called with illegal argument 4: "primary"

Entire code:

RunWait(@COMSPEC & " /c Start fvw.exe")
WinWait("FalconView -","")
If Not WinActive("FalconView -","") Then WinActivate("FalconView -","")
WinWaitActive("FalconView -","")
Send("{CTRLDOWN}n{CTRLUP}")
WinWait("New","")
If Not WinActive("New","") Then WinActivate("New","")
WinWaitActive("New","")
Send("rppp{ENTER}")
if WinExists("Tabular Editor -") = 0 Then ControlClick("FalconView", "",1617, "primary", 1, 15, 115)
WinWait("Tabular Editor -","")
If Not WinActive("Tabular Editor -","") Then WinActivate("Tabular Editor -","")
WinWaitActive("Tabular Editor -","")
Send("!di")
WinWait("Select Data Source","")
If Not WinActive("Select Data Source","") Then WinActivate("Select Data Source","")
Send("!n")
Send("C:\Pfps\MPU\TXT2LPT\Output TXT\FalconView Text file.txt{ENTER}")
WinWaitActive("Text Import Wizard")
Send("+{TAB 1}") 
Send("{ENTER}")
WinWaitActive("Load Import Settings")
Send("!n")
Send("C:\Pfps\Data\ImportSettings\MPU© - TXT2LPT - Import Settings - 5. Maj 2008.ipt")
Send("{ENTER}")
WinWaitActive("Import Information")
Send("{ENTER}")

Any help is very welcome!

/Thomas

Denmark

Posted

I saw in your code something like this "Tabular Editor -". If this is not a full title name use AutoitSetOption("WinTitleMatchMode",2).

About your error be sure of control ID.

Posted

Thank you Andreik!

It seems to bee the "Auto test.au3" in SciTE that is coursing the error (or wrongly reporting an error).

I added the AutoitSetOption("WinTitleMatchMode",2) I hope in the correct location?!?

/Thomas

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.12.1
 Author:         Thomas Larsen

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
AutoitSetOption("WinTitleMatchMode",2)
RunWait(@COMSPEC & " /c Start fvw.exe")
WinWait("FalconView -","")
If Not WinActive("FalconView -","") Then WinActivate("FalconView -","")
WinWaitActive("FalconView -","")
Send("{CTRLDOWN}n{CTRLUP}")
WinActivate("New","")
WinWaitActive("New","")
Send("rppp")
Send("{ENTER}" )
if WinExists("Tabular Editor -") = 0 Then ControlClick("FalconView", "","[ID:1617]", "main", 1, 15, 115)
WinWait("Tabular Editor -","")
If Not WinActive("Tabular Editor -","") Then WinActivate("Tabular Editor -","")
WinWaitActive("Tabular Editor -","")
Send("!di")
WinWait("Select Data Source","")
If Not WinActive("Select Data Source","") Then WinActivate("Select Data Source","")
Send("!n")
Send("C:\Pfps\MPU\TXT2LPT\Output TXT\FalconView Text file.txt{ENTER}")
WinWaitActive("Text Import Wizard")
Send("+{TAB 1}") 
Send("{ENTER}")
WinWaitActive("Load Import Settings")
Send("!n")
Send("C:\Pfps\Data\ImportSettings\MPU© - TXT2LPT - Import Settings - 5. Maj 2008.ipt")
Send("{ENTER}")
WinWaitActive("Import Information")
Send("{ENTER}")
Posted

Recce

From the help:

Button Normal Swapped

"" Lef Left

"left" Left Left

"middle" Middle Middle

"right" Right Right

"primary" Left Right

"main" Left Right

"secondary" Right Left

"menu" Right Left

Primary and Main is the Left mouse button.

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