Jump to content

Recommended Posts

fchelp

Hi,

I'm trying to get the value of

WinTitleMatchMode

so i checked the help file, and it says  "If the param is not provided, then the function just returns the value already assigned to the option."

So i'm running this line in SciTE

AutoItSetOption( "WinTitleMatchMode" )

And am checking the output, but the only output i'm getting is 

Quote

+>13:15:42 AutoIt3.exe ended.rc:0
+>13:15:42 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 0.9874

What am i doing wrong?

I'm trying to set it that it should do exact match on titles, but i want to see first what is the current setting.

Thanks in advance!

Edited by fchelp

Share this post


Link to post
Share on other sites
Jos
2 minutes ago, fchelp said:

What am i doing wrong?

What were you expecting as that statement will return the current value but you aren't doing anything with it.
In case you were expecting a Console message you need to tell the script to do so like:

ConsoleWrite('AutoItSetOption( "WinTitleMatchMode" ) = ' & AutoItSetOption( "WinTitleMatchMode" ) & @CRLF )

Jos

  • Like 1

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

Share this post


Link to post
Share on other sites
fchelp
2 minutes ago, Jos said:

What were you expecting as that statement will return the current value but you aren't doing anything with it.
In case you were expecting a Console message you need to tell the script to do so like:

ConsoleWrite('AutoItSetOption( "WinTitleMatchMode" ) = ' & AutoItSetOption( "WinTitleMatchMode" ) & @CRLF )

Jos

Thanks!

 

But could you please explain the code you wrote? i'm trying to learn, and i'm wondering why doesn't this work? (i tested it)

ConsoleWrite('AutoItSetOption( "WinTitleMatchMode" )' & @CRLF )

 

Share this post


Link to post
Share on other sites
Jos

Because you are telling AutoIt3 to write that exact literal string: 'AutoItSetOption( "WinTitleMatchMode" )' ... not to perform the function.
Just try understanding the scriptline I wrote. :)

Jos

  • Like 1

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

Share this post


Link to post
Share on other sites
fchelp
9 minutes ago, Jos said:

Because you are telling AutoIt3 to write that exact literal string: 'AutoItSetOption( "WinTitleMatchMode" )' ... not to perform the function.
Just try understanding the scriptline I wrote. :)

Jos

Got you halfway.
I was able to get the data like this

$ttest = AutoItSetOption( "WinTitleMatchMode" )
ConsoleWrite($ttest & @CRLF )

But i still don't understand how your script line works.

Is there a help file i could read that explains how to output the result of a commend in Consolewrite without setting it first as a variable? (as it seems this is what you did, i just don't understand how it works)

NVM disregard that, i figured that out, it's 

ConsoleWrite( AutoItSetOption( "WinTitleMatchMode" ) & @CRLF )

Now why did you need to make that long line of code?

 

Thanks so much for your patience!

Edited by fchelp

Share this post


Link to post
Share on other sites
Jos
ConsoleWrite('this part is just text also called literal string = ' & AutoItSetOption( "WinTitleMatchMode" ) & @CRLF )

So that line simply concatenates a String with the result of the function: AutoItSetOption( "WinTitleMatchMode" ) and concatenates a CRLF at the end. :)

Jos

  • Like 1

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

Share this post


Link to post
Share on other sites
fchelp
4 minutes ago, Jos said:
ConsoleWrite('this part is just text also called literal string = ' & AutoItSetOption( "WinTitleMatchMode" ) & @CRLF )

So that line simply concatenates a String with the result of the function: AutoItSetOption( "WinTitleMatchMode" ) and concatenates a CRLF at the end. :)

Jos

Thanks! i got it in the same second you wrote it :)

Share this post


Link to post
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

  • Similar Content

    • c1one
      By c1one
      Something simple enough, and I am sure it's an oversight, but I have not been able to track this down. The entire script is attached, but here is the point of failure.
      Note: I am getting the "Error: subscript used on non-accessible variable" but I thought the initial line of:
      AutoItSetOption('MouseCoordMode', 0)
      Should address that issue? 
      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      ; Install updates (minimized and updating for many minutes)
      ; Updates Not Installed Screen
         ; Wait for updates to complete
      WinWait("ProSeries Update")
         ; Wait just over 9 minutes to ensure popup is ready (test alternative to WinWait)
      Sleep(550000)
         ; Set focus on Product Licenses window
      WinActivate("ProSeries Update")
         ; Send Mouse Click to Install Now button
      MouseClick ( "left" [, 581, 362 [, clicks = 1 [, speed = 10]]] )
      ; end Installing Updates screen
      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
       
      Thanks for any insights!
      c1one
      ProSeries2017_No_Customer_Info.au3
    • jdegraff
      By jdegraff
      I created a quick script to set/clear the topmost status of a window. It works like
          top <title> /on | /off
          
      I want the title match to be case insensitive and to work on partial strings. For example, if the window of note is titled "APLX for Windows" I want
          top apl /on
          
      to work. The AutoIt manual says that for WinTitleMatchMode
          Mode -1 to -4
              Force lower case match according to other type of match.
      so I assumed that by
          aut.Opt "WinTitleMatchMode",-1
          
      I would be doing a lower case match on existing windows. As long as I lcase(title) for the comparison it should match on "APLX for Windows" but it does not Is this a bug or am I misreading the docs?    
×