Jump to content

�primary� or �main� in �ControlClick� returns error


Recce
 Share

Recommended Posts

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

Link to comment
Share on other sites

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}")
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This is simply a bug. Reported and fixed in BugTrac for 3.2.13.8 Beta: ControlClick with "new" buttons syntax error (au3check)

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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