Jump to content

Determine which language my Internet explorer is running.


Recommended Posts

Basically what i put on the title of the the thread.

I need to know which macro or function should i use to tell autoit to do specific groupd of functions wether its using english, spanish or italian Internet explorer

So i can do a single autoit instead of making one for every language .

thnx.

Edited by LucasM
Link to comment
Share on other sites

Well the problem is that using that "function" im not being able to complete the expression.

I dont know what to do. This is what i wrote so far.

If _IEPropertyGet ($ie9handle, "browserlanguage") = StringInStr("0409 0809 0c09 1009 1409 1809 1c09 2009 2409 2809 2c09 3009 3409", @OSLang) Then

Send("!{F4}")

EndIf

I assume that the first part refers to the return value that " browserlanguage" should return. taking $Ie9handle as the variable used for a specific I explorer window

Where it says "browserlanguage" its supoused to return a value that im not getting. Also when i verify if there`s any error.

It Says that _IEPropertyGet its an unknown funcion.

isnt it a prestablished function ?

What im i doing wrong guys ?

Can anybody help me ?

Link to comment
Share on other sites

#include <IE.au3>
Local $oIE = _IE_Example("basic")
ConsoleWrite(_IEPropertyGet($oIE, "browserlanguage") & @LF)

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Did you run it?

It prints to the scite console the language the browser is currently using. In my case it would display "en-us" for English US.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

indeed. But my question is how can i use that "return value" to tell the autoit how to proceed.. EX

func dependlanguage($window)

if returnvalue = english then

send(more complex stuf)

if returnvalue = spanish then

send(spanish hotkeys)

Endif

Endfunc

Link to comment
Share on other sites

Once again I have to ask, did you run it? The return value is displayed in the SciTE console when it's run, use the value it returns to run your script the way you need, depending upon what that value is.

An If/Then statement is basic scripting, and if you don't know how to use an If statement, you need to go through the tutorials and the help file before you can even begin to start with something like this.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

BrewmanNH thnx for your help, but i actually learned how to use If/then statements. The problem is that im looking at the return values displayed on the @oslang table. and they`re not the same as autoits return

when i execute youir script. do u know what i mean ?

The way i fugured out was something like aberration explained, but just a thought.... do i need to run BrewmanNH script to know the value in every layer im testing or is there a table to simplify steps? Otherwise..

it was an awesome help guys.

Link to comment
Share on other sites

#include <IE.au3>

Local $oIE = _IE_Example("basic")

ConsoleWrite(_IEPropertyGet($oIE, "browserlanguage") & @LF)

The problem is that i need to use another handler on _IEPropertyGet function.

This is what i`ve done so far.

[ autoit ] ( )

Func FileMenuTests($window)

Local $oIE = _IE_Example("basic")

Local $IELanguage = _IEPropertyGet($oIE , "browserlanguage") - my handler actually is $ie9handle but the only way i get to use porperty get.. is this way.

ConsoleWrite("Language: " & $IELanguage)

Select

Case not StringInStr ( $IELanguage, "en-us") = 0

If @OSArch = "X86" Then

if @OSVersion = "WIN_7" Then

FileMenuTestsx32($window)

EndIf

ElseIf @OSArch = "X64" Then

if @OSversion = "WIN_7" Then

FileMenuTestsx64($window)

EndIf

EndIf

Case Not StringInStr ( $IELanguage, "") = 0

EndSelect

EndFunc

is it because $oIE handler refers to #include <IE.au3>?

how can i make this work for me ?

Link to comment
Share on other sites

Is it really so hard to figure out that you need to replace the $oIE with $ie9handle? Also, you don't need the line Local $oIE = _IE_Example("basic") if you already have a window open, that was only there as a demonstration of how to use "browserlanguage", it's not necessary to use it every time.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

i see, but when i try to use _IEPropertyGet("", "browserlanguage") nothing happens. So im having some kind of issue. Thats why i tried the "$oIE" thing.

Ive looked up the iEpropertyget help file... but i cant figure out what i need to do..

neither my or my work partners.. ç

we are stucked here.-

Link to comment
Share on other sites

Why in the world would you put in a blank object parameter and expect it to work? You said your handle was $ie9handle, did you TRY that at all?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Posting ALL of your code will definitely help with your problem, because right now there's not enough of it to say what the problem is.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

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