Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all 12506 articles
Browse latest View live

How to send TAB function to an inactive window

$
0
0

Hi,

 

Anyone knows how to send TAB Function to an inactive window...can we use controlsend to do this...if so please let me know hoe to do .

 

TIA


Need help on script

$
0
0

Hi Guys,

 

I'm new to this and have followed some of the tutorials etc.  I am starting to make my first script to automate a installation of a program - Unfortunately there is no silent install.

 

This is what I have so far however even though it recognises that the window is active it will not simulate pressing enter to proceed to next screen. Even using Send("!n") doesn't work.

 

AM I missing something?

 

My platform is Win 7 64bit

#include <MsgBoxConstants.au3> #include <Constants.au3> Run('OridionPCUtilities.exe') Sleep(20000) ; Wait for splash screen to disappear Local $hWnd = WinWait("[TITLE:Setup - Oridion PCUtilities]", "", 20) WinActivate($hWnd) If WinActive("Setup - Oridion PCUtilities") Then ; Check if Notepad is currently active.     ;MsgBox($MB_SYSTEMMODAL, "", "WinActive" & @CRLF & "Window is active.")     Send("{ENTER}") Else     MsgBox($MB_SYSTEMMODAL, "", "WinActive" & @CRLF & "Window is not active.") EndIf

Here is a simmary of the infomation provided by au3info:

 

 

>>>> Window <<<<
Title: Setup - Oridion PCUtilities
Class: TWizardForm
Position: 606, 346
Size: 503, 388
Style: 0x16CA0000
ExStyle: 0x00000100
Handle: 0x0000000000100F42

>>>> Control <<<<
Class: TNewStaticText
Instance: 2
ClassnameNN: TNewStaticText2
Name: 
Advanced (Class): [CLASS:TNewStaticText; INSTANCE:2]
ID: 921522
Text: This will install Oridion PCUtilities 3.31.3.7 on your computer.

It is recommended that you close all other applications before continuing.

Click Next to continue, or Cancel to exit Setup.
Position: 176, 71
Size: 301, 239
ControlClick Coords: 121, 165
Style: 0x54000180
ExStyle: 0x00000000
Handle: 0x00000000000E0FB2

>>>> Mouse <<<<
Position: 906, 607
Cursor ID: 13
Color: 0xFFFFFF

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Welcome to the Oridion PCUtilities Setup Wizard

This will install Oridion PCUtilities 3.31.3.7 on your computer.

It is recommended that you close all other applications before continuing.

Click Next to continue, or Cancel to exit Setup.
&Next >
Cancel

>>>> Hidden Text <<<<
Please enter the Installation Code, then click Next.

SOFTWARE LICENSE  AGREEMENT

< &Back

 

 

autoit script doesn't work remotely

$
0
0

Hi, I write following script:

While 1
    If WinExists("Windows Security") Then
   WinSetState("Windows Security","",@SW_SHOW)
        WinActivate("Windows Security")
        WinWaitActive ("Windows Security", "" ,30)
        ControlClick ("Windows Security", "", "Cancel")
        Exit
    EndIf
    Sleep(1000)
Wend
 
It clicks on security window which appears after I navigate to special url address. This script works perfect on my local pc. And it works on remote machine than I'm logged in and it is in the full screen. As soon as I minimize window with remote machine script doesn't work.
 
I run autoit script from java on local machine like:
 Runtime.getRuntime().exec("C:\\windows_security.exe");
 
And I run it on remote machine from java like:
   Robotil robotil = new Robotil("ip_of_remote_machine", 6666);
   robotil.invokeApplication("C:\\autosctipt.exe");
 
Could someone advise me how make this script run on remote machine then it is monimize and even then I am not logged in?

IntegerWrite (NomadMemory.au3)

$
0
0

Hello all can anyone tell me how to integer write? here is my cutted source :

Case $Flash     If $Flash = 1 Then     _MemoryWrite(_MemoryRead(0x54890A,$open)+0x200,$open,int(0x30)) Elseif $Flash = 0 Then _MemoryWrite(_MemoryRead(0x54890A,$open)+0x200,$open,int(0x3F)) EndIf

Thanks

Report Bug in _IEDocInsertHTML

$
0
0

Using function _IEDocInsertHTML  with autoit 3.2 and internet explorer 9 give back the following message:

 

$_IEStatus_InvalidObjectType, Expected document element.

 

Looking at IE.au3 you can see a if block:

 

If Not __IEIsObjType($o_object, "browserdom")  Or __IEIsObjType($o_object, "documentcontainer") Or __IEIsObjType($o_object, "document") Then
        __IEConsoleWriteError("Error", "_IEDocInsertHTML", "$_IEStatus_InvalidObjectType", "Expected document element")
        Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf

 

 

If you limit the control to __IEIsObjType($o_object, "browserdom") the function works, so probably something goes wrong with the evaluation. You can easily reproduce the problem with the following code:

 

#include <IE.au3>

Local $oIE = _IECreate("http://www.autoitscript.com")

Local $oBody = _IETagNameGetCollection($oIE, "body", 0)

_IEDocInsertHTML($oBody, "<h2><font color=red>This HTML is inserted After Begin</font></h2>", "afterbegin") _IEDocInsertHTML($oBody, "<h2><font color=red>This HTML is inserted Before End</font></h2>", "beforeend")

 

 

Hope this Helps.

Heros

 

 

char array in C/C++ and in DllStruct* function

$
0
0

Hi Guys,

 

  I have a little question want to understand :

 

  suppose a char array -- "char[100]", it is 100 bytes, every element is 1 byte.  In the C/C++, if I pass some unicode characters (assume every unicode needs 2 bytes.) in this array, I know  per 2 element can represent a unicode character and C/C++ can output them normally.

  

   But in the Autoit, when I call the Dllstruct* function, the code as below:

$a = DllStructCreate("char text[2]") ; this array only 2 bytes DllStructSetData($a, "text", "你"); this character is chinese $b = DllStructGetData($a, 1) MsgBox(4096, "", $b); it can output normally, no problem

this code is working, BUT.........if I change as below:

$a = DllStructCreate("char text[10]"); it has 10 bytes DllStructSetData($a, "text", "你好"); 2 Chinese characters $b = DllStructGetData($a, 1) MsgBox(4096, "", $b); output is "你?"

Why?

:ermm:  Maybe I have little obsessive-compulsive disorder.......

 

Anyway, thanks in advance for your help. :zorro:

Finding value in registry

$
0
0

I am querying a group of computers to see if they use a specific homepage for Internet Explorer.  This is located at HKEY_Current_User\Software\Microsoft\Internet Explorer\Main and the registry name I believe for IE is "Start Page."  Ideally, if it finds the start page URL that I list in the script, I want it to return an exit code.  Not sure of best way to write it though.

 

Something like...

 

If StartPage = xxx, 

return exit code 1

If StartPage = yyy,

return exit code 2

If StartPage = zzz,

return exit code 3

else

return exit code 0

 

 

 

Along those lines. Any help is appreciated, I'm sort of stuck  :/

 

Get Audio Master Volume Level

$
0
0

Hello, Is there a way to get the audio master volume level? Thanks!

 

PS. I couldn't find such feature even with nircmd.exe.


How can I retrieve a Dynamic Control ID ?

$
0
0

Hi All:

Using AutoIT (v3.3.10.2) I am trying to automate a test for a handheld device using an emulator named MyMobiler on Windows 7.

The screen shots and relevant steps of my problem could be seen in the link below:

 

http://howtoreaddynamiccontrolid.blogspot.ca/

 

Problem description:

  1. Each time I start the emulator the Control ID changes to something new. It means, each new instance of the emulator will generate dynamic Control ID
  2. In my AutoIT script, how can I read this dynamic Control ID value of the emulator and use in the rest of the script without doing change the script every time I would run the test

Thanks

 

 

Read/Write Line-by-Line txt file

$
0
0

I'm having difficulty putting together a script that will Read line by line and create a new txt file with aditional material.

Example of input.txt
"C:\Item 0x796D.bmp"
"C:\Item 0x796E.bmp"

Example of output.txt
<item index="0x796D" file="C:\Item 0x796D.bmp" remove="False" />

<item index="0x796E" file="C:\Item 0x796E.bmp" remove="False" />

I want to learn, i'll admit i'm having trouble getting started with this particular script and I have done searches for information on this before posting this and even after i've posted this thread ill continue to be searching the forums for useful information.
Feel free to yell at me else Thank you for your time.

GUICtrlSetState( Eval("strng"), $GUI_CHECKED)

$
0
0

GUICtrlSetState( $cbTrks, $GUI_CHECKED) works. If I only have the string "$cbTrks" how can I get the reference needed? tia.

Access is denied when compiling

$
0
0

Hi.

 

 I just installed the latest full editor , and when I tried to compile my script it gace me an "Access is denied." message.

 

 I didn't have it on the regular editor.

 

 Any help will be great!

 

Thanks!

 

 

No bass with 5.1 system playing 2.1 files?

$
0
0
Hi!
I've recently bought a 5.1 speaker system. Now I know I can't get full sorround sound when playing 2.1 audio/video files or watching youtube or what not. But I want all speakers to play sound. 
 
Currently only the 2 front speaker play sounds. I've got 5.1 configured, updated all drivers and it's not problem. When I test 5.1 sorround sound all speakers work. But when I play anything but that (2.1) sound only comes from the 2 front speakers.
 
I have got my receiver connected to an HDMi cable and everything seems to work fine.
 
The biggest problem is that the subwoofer isn't utalized at all. I bought a really big subwoofer for the insane sound. But now the two front speakers play all the base sounds, making it lame.
 
 
The solution to this I would presume to be the "Speaker fill" option in the enhancements tab since that is just what I'm asking for. But the option is not there, the question is: is there any way to force this or any other alike workaround.
 
Any ideas?

How to select (list view/tree view) item in Save As window

$
0
0

Hello All,

 

I need help with selecting items in the save as dialogue box

 

I surf the net and Autoit forum but none of the solutions seem to work for me

 

below is the code I have worked with which is basically not doing what i wanted

the file still get saved in the previous selected folder.

 

I want the file to be saved in what ever folder i indicated in my code.

    WinWaitActive("Save As", "&Save", 10)     Sleep(1000)     If ControlTreeView("Save As", "", 100, "Exist", "Desktop") Then     ControlTreeView($windowname, "", 100, "Select", "Desktop|My Folder") ; to save file in My Folder (specific folder of choice)            Else                 MsgBox(0, "not existing", "this is not working"); i am trying to check if the first example works if not try other option     WinWaitActive("Save As", "")     ControlClick("Save As", "", "[CLASS:Button; INSTANCE:100]")     $hTree = ControlGetHandle("Save As", "", "[CLASS:SysTreeView32; INSTANCE:100]") ; get handle to the treeview window         ControlTreeView("Save As", "", $hTree, "Expand", "#0|#13") ; expand a node         ControlTreeView("Save As", "", $hTree, "Expand", "#0|#13|#10") ; expand a child node of the above node     EndIf     ControlSend($windowname, "", $control, "file name" & ".pdf")     ControlClick($windowname, "&Save", 1, "left", 1)

My file still saves still does not save in the specified folder. :sweating:

 

Thanks for the help in advance 

 

importing from text file to listview

$
0
0

txt file example attached

 

what's the easiest/fastest way of that info to be imported into listview

 

by some predictions my listview will have maximum of 200 rows.

 

column separator is "|"

 

im using melba's UDF GUIListViewEx.au3 for listview controls

 

i am successfully using _GUIListViewEx_ReadToArray to export listview to that text file

 

i dont know if function _GUIListViewEx_ReturnArray is used to import values to listview

tried some combination but couldnt get it to work.

 

can anyone help?

 

also i think melba helped me with this.

Attached Files


problem with CompInfo.au3

$
0
0

Hi, i wrote this little program

AutoIt         
#include <CompInfo.au3> #Region ;~~ Computer Infomartion     Local $CompInf     Local $CPURam     Local $CPUInfo = ''     $CPUInfo &= '===>CPU Information' & @CRLF     _ComputerGetOSs($CompInf)     $CompInf = StringSplit($CompInf[1][0], '|')     $CPUInfo &= 'OS: ' & @TAB & @TAB & @TAB & $CompInf[1] & @CRLF     _ComputerGetSystem($CompInf)     $CPUInfo &= 'System: ' & @TAB & @TAB & $CompInf[1][46] & @CRLF     _ComputerGetProcessors($CompInf)     $CPUInfo &= 'CPU: ' & @TAB & @TAB & @TAB & $CompInf[1][0] & @CRLF     _ComputerGetMemory($CompInf)     For $i = 1 To $CompInf[0][0]         $CPURam += $CompInf[$i][2]     Next     $CPUInfo &= 'Ram: ' & @TAB & @TAB & @TAB & Round(Number($CPURam/1024^2)) & ' MB' & @CRLF     _ComputerGetVideoCards($CompInf)     For $i = 1 To $CompInf[0][0]         $CPUInfo &= 'VGA' & $i & ': ' & @TAB & @TAB & @TAB & $CompInf[$i][0] & @CRLF     Next     _ComputerGetMonitors($CompInf)     For $i = 1 To $CompInf[0][0]         $CPUInfo &= 'Monitor' & $i & ': ' & @TAB & @TAB & $CompInf[$i][21] & '*' & $CompInf[$i][20] & @CRLF     Next #EndRegion MsgBox(0, '', $CPUInfo)

all it does is fetch some information about my computer. It worked well before i formatted my PC. Now when i run the script the icon just appears in the tray and after 5s it disappears, without any messageboxes.. 

if i remove all functions except _ComputerGetOSs and _ComputerGetMemory, the program will work. Any idea why the others do not work?

Error with AutoIt 1-2-3

$
0
0

Hello all.   I downloaded and installed AutoIt 1-2-3 along with SciTE - Editor.   When running AutoIt 1-2-3, Step Number 2 , I get the error below:

 

tyfx.png

 

 

I downloaded both programs twice in case there was some corruption the first time but it didn't help.

 

Thoughts?   :)

 

 

Regards, Dave

Help with array and _FileListToArrayRec()

$
0
0

What is the best way to get an array list from a directory structure of music\artists\albums\songs?  Maybe a 3d array like:

$arr[artist][album][songs]  or maybe separate array for each category. I will later need to display the artists in a form which will list the albums and songs based on the artist selected. A 3d array would allow me to easily list all the song or albums under a specific artist.

 

 

CurrentIy, I am using _FileListToArrayRec which puts everything in a 1 dimensional array.

Example() Func Example()     $dir = "C:\test"   song names are listed under test\artist\album\songname     ; A list of all mp3 songs with full path     Local $aArray = _FileListToArrayRec($dir, "*.mp3||*.*", 13, 1, 1, 1)     ConsoleWrite("Error: " & @error & " - " & " Extended: " & @extended & @CRLF)     _ArrayDisplay($aArray, "Sorted tree") EndFunc

Documentation of ObjEvent

$
0
0

Hello,

I have a question regarding a sentence in the documentation of ObjEvent function.

 

 

ObjEvent ( "AutoIt.Error" [, "function"] )

....

If the second parameter is omitted, it will return the name of the current Error handler function or function, depending what was used when registering.

 

Is there a typo? Or what is meant by " ... or function"?

 

/Indi2Go

Error function RegWrite

$
0
0

Hi all i'm trying to write a key in the the regestry but it always return @error 1. This is the code:

$key=InputBox("My program","Insert key for run this program") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\My-program","Key","REG_SZ",$key) $error=@error MsgBox(0,"",$error)

The folder My-program doesn't exist maybe this is the problem?

thanx.

Viewing all 12506 articles
Browse latest View live