Jump to content

Get AutoItSetOption value


fchelp
 Share

Recommended Posts

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

  • Developers
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

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

Link to comment
Share on other sites

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 )

 

Link to comment
Share on other sites

  • Developers

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

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

Link to comment
Share on other sites

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

  • Developers
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

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

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

×
×
  • Create New...