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

"window management" question _ Beginner.

$
0
0

Hi everyone.. :bye:

 

I am new to autoit, as a beginning, I am automating installation of some windows applications.

 

it was fine till i tried to automate installation of programs such as office2010 or kaspersky internet security 2014.

 

the problem is that successive installation windows share the same title, besides, when using "autoit window info" there is no visible text at all (for all windows). other window characteristics are exactly the same.

 

So how to distingush installation windows from each other in script?

 

i need to know when the installation process window (the one with progress bar) is completed and final window shows up so that i close it and begin activating the program.

 

I do not want to use "sleep" since there is no knowing as how much time this process is going to take on different PC's.

 


Working with IE after changing it's visibility status

$
0
0

Hi, I recently updated to 3.3.12.0 version of autoit (didn't update for a long time) and trying to edit some of my scripts.

So I encountered a problem. I open IE window, which is invisible:

$oIE = _IECreate("supply.wowgold.ru/new/",0,0) _IELoadWait($oIE) $ievisible=0

And each 2 seconds it reloads page and runs

$sHTML = _IEDocReadHTML($oIE)

But after I make it visible with function

Func ievisible()    If $ievisible=0 Then  _IEAction($oIE,"visible")  $ievisible=1    ElseIf $ievisible=1 Then  _IEAction($oIE,"Invisible")  $ievisible=0    EndIf EndFunc

Autoit can't work with it and puts such messages into console:

--> IE.au3 T3.0-1 Error from function _IELoadWait, $_IESTATUS_ClientDisconnected (-2147417848, Browser has been deleted prior to operation.) --> IE.au3 T3.0-1 Error from function _IELoadWait, $_IESTATUS_InvalidObjectType () --> IE.au3 T3.0-1 Error from function _IEDocReadHTML, $_IESTATUS_InvalidObjectType (Expected document element) --> IE.au3 T3.0-1 Error from function _IENavigate, $_IESTATUS_InvalidObjectType --> IE.au3 T3.0-1 Error from function _IELoadWait, $_IESTATUS_InvalidObjectType () --> IE.au3 T3.0-1 Error from function _IEDocReadHTML, $_IESTATUS_InvalidObjectType (Expected document element) --> IE.au3 T3.0-1 Error from function _IENavigate, $_IESTATUS_InvalidObjectType --> IE.au3 T3.0-1 Error from function _IELoadWait, $_IESTATUS_InvalidObjectType () --> IE.au3 T3.0-1 Error from function _IEDocReadHTML, $_IESTATUS_InvalidObjectType (Expected document element) --> IE.au3 T3.0-1 Error from function _IEAction(visible), $_IESTATUS_InvalidObjectType --> IE.au3 T3.0-1 Error from function _IEAction(invisible), $_IESTATUS_InvalidObjectType --> IE.au3 T3.0-1 Error from function _IEAction(visible), $_IESTATUS_InvalidObjectType --> IE.au3 T3.0-1 Error from function _IEAction(invisible), $_IESTATUS_InvalidObjectType --> IE.au3 T3.0-1 Error from function _IEAction(visible), $_IESTATUS_InvalidObjectType --> IE.au3 T3.0-1 Error from function _IEAction(invisible), $_IESTATUS_InvalidObjectType --> IE.au3 T3.0-1 Error from function _IEAction(visible), $_IESTATUS_InvalidObjectType --> IE.au3 T3.0-1 Error from function _IENavigate, $_IESTATUS_InvalidObjectType --> IE.au3 T3.0-1 Error from function _IELoadWait, $_IESTATUS_InvalidObjectType () --> IE.au3 T3.0-1 Error from function _IEDocReadHTML, $_IESTATUS_InvalidObjectType (Expected document element)

Can you halp me pls? It worked before update :(

Thanks!

 

ok, i give up =/ , what is wrong with my script?

$
0
0

hi, any one see my problem?

 

i think i have a problem in the for to next loop but i cant quite get it right

AutoIt         
 #include <Array.au3> HotKeySet("{F11}", "display") TCPStartup() $Main_Socket = TCPListen(@IPAddress1,999) If $Main_Socket = -1 then exit Local $Channel_Socket[1][2] $Channel_Socket[0][0]= -1 $Channel_Socket[0][1]= "" While 1     $Channel_Socket = Incoming_Connections($Main_Socket) ConsoleWrite ('+'&@LF) sleep(1000) WEnd Func Incoming_Connections($Main_Socket) ;~  ConsoleWrite ('UBound($Channel_Socket,0)= '&UBound($Channel_Socket,0)&@lf)     ConsoleWrite ('UBound($Channel_Socket,1)= '&UBound($Channel_Socket,1)&@lf) ;~  ConsoleWrite ('UBound($Channel_Socket,2)= '&UBound($Channel_Socket,2)&@lf)     For $sotket=0 to UBound($Channel_Socket,1)-1         ConsoleWrite ('$Channel_Socket['&$sotket&'][0]='&$Channel_Socket[$sotket][0]&@LF)         ConsoleWrite ('$Channel_Socket['&$sotket&'][1]='&$Channel_Socket[$sotket][1]&@LF) ;~      _ArrayDisplay($Channel_Socket,"")         If $Channel_Socket[$sotket][0] = -1 Then             $Channel_Socket[$sotket][0] = TCPAccept($Main_Socket)             if $Channel_Socket[$sotket][0] <> -1 then                 $Channel_Socket[$sotket][1] = Timerinit()                 ConsoleWrite('+New Conection Detected'&@lf)                 _ArrayAdd($Channel_Socket,-1&'|')             EndIf         Else             _ReadChannel_Socket($sotket)         EndIf     Next     Return $Channel_Socket EndFunc Func _ReadChannel_Socket($sotket)     $datex = TCPRecv($Channel_Socket[$sotket][0],500)     If $datex <> "" then consolewrite ('!$datex='&$datex&@LF) EndFunc Func display()     _ArrayDisplay($Channel_Socket,"") EndFunc

if i send data like the examble below, i only get the test1, and if i add more TCPsends,  the last tcpsend does not get to the tcp reader func

TCPStartup() $sokete = TCPConnect('192.168.1.4',999) if $sokete = -1 Then Exit SLEEP(1000) TCPSend($sokete,"test1") SLEEP(1000) TCPSend($sokete,"test2")

any help appreciated

Having problems with new Excel UDF

$
0
0

I am struggling a little converting over to the new Excel UDF. After I execute the following script (open workbook and delete the "Summary" sheet and save workbook), the excel file seems to be corrupted since I can not open it in Excel. 

 Appreciate any thoughts.

Ian

#include <excel.au3> $oExcel = _Excel_Open(False) $oExcelWB = _Excel_BookOpen($oExcel, "c:\temp\test.xlsx", False, False) _Excel_SheetDelete($oExcelWB, "Summary") _Excel_booksave($oExcelWB) _Excel_Close($oExcel) Exit

Sr, can i help me !!!

$
0
0

Dear all,

i have a problem

i write a autoit script for a website. this web have button when i click this button , a other website is created (popup)

my goal is i want to get url popup website

when i inspect element that button , it display as:

 

(<a href="javascript:void(0);" onclick="ModulePopup('446797','https://www.facebook.com/pages/H%E1%BA%A2I-S%E1%BA%A2N-T%C6%AF%C6%A0I-S%E1%BB%90NG/838221676190845?ref=hl,Facebook,5,1');" class="followbutton">Like</a>)

 

can you get url :https://www.facebook.com/pages/H%E1%BA%A2I-S%E1%BA%A2N-T%C6%AF%C6%A0I-S%E1%BB%90NG/838221676190845?ref=hl

 

then store it in a variable example $oIE

 

can i help me this , thanks.

sr because of my english, i am vietnamese.

thanks all.

How to add a value in a cell in Excel ?

$
0
0

I saw in the Help File, the UDF for managing Excel 2013 and on Windows 7, but I can't manage how can I add silently a specific value in a specific cell in a specific Excel file :(

Pls help me

And yes I updated to the last version of Autoit...

DirGetSize not working with NTFS?

$
0
0

Hi,

 

due to http://www.autoitscript.com/forum/topic/78713-dircopy-progressbar-pure-autoit/?hl=%2Bdirgetsize+%2Bntfs (first post) and to my own experiences I don't think that I can use DirGetSize(destination folder) while copying.

 

Part of my script:

$pid = Run('"' & @AutoItExe & '" /AutoIt3ExecuteLine "Dircopy(' & $qpo & ',' & $zpo & ')"') While 1     If Not ProcessExists($pid) Then ExitLoop     $zsize = DirGetSize($dest)     $zprosize = Int($zsize / ($qsize / 100))     GUICtrlSetData($zprozent,$zprosize) ;Refresh GUICtrlProgress     GUICtrlSetData($kopiert,Round ($zsize / 1000, 0) & " KB von " & Round ($qsize / 1000, 0) & " KB kopiert")     Sleep(1) WEnd

Within some seconds the progress bar shows 100% and the size of the destination folder how it will be in the end. But it's still copying for seconds and minutes depending of the file size.

 

Any ideas to get the real size of the still copying folder?

 

Regards, Simpel

Working with different uninstallers is getting really complicated

$
0
0

So is there a better solution to the problem?

 

Ive been throwing together some code for a multiple uninstaller, which started simply enough but is getting out of control rapidly.

The problem stems from having different types of uninstallers like this

Local $sProgramString = "" $sProgramString = "|C:\Program Files\Program1\uninstall.exe|C:\Program Files (x86)\Program2\uninstall.exe|C:\Program Files (x86)\Program3\uninstall.exe|C:\Program Files (x86)\Program4\ExtCapUninstall\hpzscr01.exe|C:\Program Files (x86)\Program5\uninstal.exe|C:\PROGRA~1\Program6\bar\1.bin\mwsbar.dll

Which starts them fine but then i ran across MSI and other types with switches so i added this

    Local $aProgramArray = StringSplit($sProgramString, "|") For $i = 0 To UBound($aProgramArray) - 1     If FileExists($aProgramArray[$i]) Then         Local $UninCheck = $aProgramArray[$i]         Select             Case $UninCheck = "C:\Program Files (x86)\Program4\ExtCapUninstall\hpzscr01.exe"                 ShellExecuteWait('C:\Program Files (x86)\Program4\ExtCapUninstall\hpzscr01.exe', '-datfile hpqhsc01.dat')                 Sleep(1000)

And these

            Case $UninCheck = 'C:\Program Files (x86)\Program5\uninstal.exe'                 ShellExecuteWait('MsiExec.exe', '/X{C28D96C0-6A90-459E-A077-A6706F4EC0FC} /qb')                 Sleep(1000)

And these

            Case $UninCheck = "C:\PROGRA~1\Program6\bar\1.bin\mwsbar.dll"                 ShellExecuteWait('rundll32', 'C:\PROGRA~1\Program6\bar\1.bin\mwsbar.dll,O')                 Sleep(1000

And to close it off

            Case Else                 ShellExecuteWait($aProgramArray[$i], "")                 Sleep(1000)         EndSelect     Else         ContinueLoop     EndIf Next

Obviously i have to have the program in the top array as well as an individual Case just in case it has switches or msi etc

One problem i have also noticed is that sometimes it opens multiple ones at the same time which i was using the shellexecute wait to control... i guess the program opening cancels the wait?

 

So is there an easier way to manage this stuff than im doing it already? And i would like some way of trigger the program name in and error msg when it fails on an uninstaller

 

All it does is run them one after another until there is no more on that machine


IE.au3 Doesn't work on some PC's?

$
0
0

So here I am back with my second IE.au3 question...

 

I made a script to manipulate this website. I'm using IE11 on my computer. It's working great! No flaws; can run for hours.

 

I sent it to my friend and he ALWAYS gets an error. At first I thought it was because he didn't have Autoit installed. So I tried the script on my laptop. Works perfectly... But! My laptop was using IE9. The website wasn't displaying properly so I couldn't manually manipulate the site. I figured I needed to update so I updated to IE11 on my laptop(Same as my desktop). Now the script is giving my laptop the same error as my friend:

 

 

"error from function _IEnavigate, $_IEstatus_COMError (-2147352567)" - When I run it with SciTE.

 

When running as an .exe sometimes it does nothing and just sits there. Other times I get an error popup:

"The requested action with this object has failed. Line 82".

 

The really weird thing is that a few times I DID get the script to work on my laptop with IE11. It's pretty much refusing to work at all now though.

 

My desktop: Windows 8.1 - Internet Explorer 11

Laptop : Windows 7 - Internet Explorer 11

Friends computer: Windows 7 - Internet Explorer 11

 

Things I've tried:

-Ccleaner

-Restarting my PC

-Updating my laptop

-Disabling UAC

-Smashing my head on my desk

 

Code clip to replicate my issue:

AutoIt         
#RequireAdmin #include <IE.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> If ProcessExists("iexplore.exe") Then     Global $url = _IEAttach("Google") Else     MsgBox(0, "Hey!", "Open Internet Explorer first.")     Exit EndIf $AmountTo = 10000 _IENavigate($url, "http://www.msn.com/") $oActivitySelect = _IEGetObjByName($url, "times") _IEFormElementOptionSelect($oActivitySelect, $AmountTo) $oCalculate = _IEGetObjByName($url, "Submit") _IEAction($oCalculate, "click")

I changed the website used because I don't want to post it, so there is obviously no submit button for it to click. But this script runs fine on my desktop but gives the same error on my laptop.

 

The error happens right when I try running the script. No navigation happens.

Coding Question

$
0
0

I want to be able to store some data as follows:

 

0 = nil

1 = data 1

2 = data 2

4 = data 3

8 = data 4

16 etc 

32 etc 

64 etc

 

So that I can 'turn on' bits 1 and 8 and use a value of 9 to represent bits 1 and 8 are on.

 

Is there an easy away to figure out what bits are on if I have a number such as 43 (showing that bits 32, 8, 2, and 1 are on)

 

I looked a bit into the bit functions, however im not sure on how they work or if it is what  am needing.

 

Thank you

Need Help with IE input Submit

$
0
0
$id = _IEGetObjById($oIE, "shipinpId") $in = _IEFormElementSetValue($id, "test") $oIE.Document.parentWindow.execScript("return submitInputOnFillorEnter('#{receivingBackingBean.validateASNScanAction}', this, event);")

I use controlsend in my current script but I want to change it. So I came up with the script but it doesn't do anything 

I already tried _IEformsubmit  and _IEaction But no luck.

 

 

 

Html code

<INPUT id=shipinpId onkeydown="return submitInputOnFillorEnter('#{receivingBackingBean.validateASNScanAction}', this, event);" maxLength=20 value=test name=shipinpId>

Little bug in SciTE?

$
0
0

Not quite sure if it would be considered a bug but something to note.

 

If you put in a , in a label control creation in the text field it highlights your next argument in red as top instead of left.

 

IE:

scite.png

Image generated in PHP without download link to gui.

$
0
0

<img src="//api.solvemedia.com/papi/media?c=2@e4-RMw8-5G4uTaGxj-v1x.eXkMoLXp5T@V.dVd9F2oKsENU8bgrS8pn9APTC4lJjoNzJ2lsh4OdqFN-atpDU5icGdngaQCXKM94tMd8nn8qai6c-teJQSDR3i5WVlhytLKdBiO-.5GWImKkaVRGsFsbhmp6-fBDqzh3g.FEY2DTwWnWoNmcTGl1XfrUz9A.jxMWqlLGC8-5Non.evzQ43zhktJUge1-h2Xw9PycrYuzNq-RFIb2W3U7URCwPDGPMO9aJPOtqgWd8lksBQRCNGrKkhUHo1n74Yi04iY7KZeqv6sUWhfGSk6ykTWXPnChCWJkhFXIK0uoA;w=300;h=150;fg=000000;bg=f8f8f8" alt="Solve Media Puzzle Challenge" height="150" width="300" id="adcopy-puzzle-image-image">

I have this code... And There is a link... But if I go to this link I get error is there any way to save image in IE without link ?

Need help for expanding Treeview

$
0
0

Hello,

 

I am new to AutoIT. Its been 3 days I am learning and I am now stuck hence request you to help us. 

 

All I want is to expand a tree view. 

 

Here is the screen-shot :: 

 

2mrtctf.jpg

 

All I want to do is :

1. Lauch Eclipse

2. Click on "Help" Tab

3. Click on "About Eclipse SDK"

4. Click on "Installation Details" 

 

and then 

 

5. select is C/C++ Development Tool SDK & then Click on Un-install.

 

The code so far I have written is below :: 

AutoIt         
  1. #include <GuiTreeView.au3>
  2.  
  3.  
  4. ;Launch the eclipse
  5. Run("E:\eclipse-SDK-3.8-win32\eclipse\eclipse.exe")
  6. sleep(1000)
  7.  
  8. WinWait("Workspace Launcher")
  9. WinActivate("Workspace Launcher")
  10. ControlClick("Workspace Launcher","","Button3")
  11.  
  12. WinWait("Java - Eclipse SDK")
  13. WinActivate("Java - Eclipse SDK")
  14. Sleep(1000)
  15. Send("!h")
  16. Sleep(1000)
  17. Send("a")
  18. Sleep(1000)
  19. WinWait("About Eclipse SDK")
  20. WinActivate("About Eclipse SDK")
  21. ControlClick("About Eclipse SDK","","Button3")
  22. WinWait("Eclipse SDK Installation Details")
  23. WinActivate("Eclipse SDK Installation Details")
  24.  
  25. Local $hTreeview = ControlGetHandle('[CLASS:SysTreeView32]', '', 'SysTreeView321')

Not able to progress after this. Any help would be appreciated !! 

 

Thank you 

 

Br

vk41

 

 

Copy image to clipboard from IE

$
0
0

Is there any way ? To copy image to clipboard?
I can just copy because on page there's no link etc


Cache Delete

$
0
0

Hi all!

What to do if while I browsing, I want to delete cache?
without error message

What should rewrite?

AutoIt         
#cs     Script To Clear Chromium Family browser cache ( Google chrome, Chromium, Iron... )     Adapted of script found on <a href='http://www.winhelponline.com/blog/quickly-clear-the-google-chrome-cache-using-script/' class='bbc_url' title='External link' rel='nofollow external'>http://www.winhelponline.com/blog/quickly-clear-the-google-chrome-cache-using-script/</a>     Customizations  To clear stored passwords and Cookies, change : $_ClearPasswordsAndCookies = 0 To $_ClearPasswordsAndCookies = 1 #ce $_ClearPasswordsAndCookies = 0 $WshShell = ObjCreate ( "WScript.Shell" ) $objFSO = ObjCreate ( "Scripting.FileSystemObject" ) $_DirtyFlags = 0 $_Msg1 = "Google Chrome cache is cleared !" $_Msg2 = "Google Chrome cache could not be cleared !" If @OSVersion = "WIN_XP" Then     $_CacheLoc = $WshShell.ExpandEnvironmentStrings ( "%USERPROFILE%" ) & "\Local Settings\Application Data\Google\Chrome\User Data\Default" Else ; vista, seven     $_CacheLoc = $WshShell.ExpandEnvironmentStrings ( "%LocalAppData%" ) & "\Google\Chrome\User Data\Default" EndIf If FileExists ( $_CacheLoc ) Then     If ProcessExists ( 'Chrome.exe' ) Then Exit Msgbox ( 0, 'Exiting', 'Google Chrome Not close' & @CRLF & @CRLF & 'Close your Chrome browser first !' & @CRLF ) Else     $_CacheLoc = StringReplace ( $_CacheLoc, 'Google\Chrome', 'Chromium' ) ; if not chrome user try chromium user.     If Not FileExists ( $_CacheLoc ) Then Exit Msgbox ( 0, 'Exiting', 'Google Chrome Not found' & @CRLF & @CRLF & 'And Chromium browser Not found too ! ' & @CRLF )     If ProcessExists ( 'Chromium.exe' ) Or ProcessExists ( 'iron.exe' ) Then Exit Msgbox ( 0, 'Exiting', 'Chromium Not close' & @CRLF & @CRLF & 'Close your Chromium or Iron browser first !' & @CRLF ) EndIf $_CacheSize = Round ( DirGetSize ( $_CacheLoc & '\Cache' ) / 1024 /1024 ) Msgbox ( 0, 'Found', 'Cache Directory Size : ' & $_CacheSize & ' MB', 3 ) If $objFSO.FolderExists ( $_CacheLoc ) Then     $objFolder = $objFSO.GetFolder ( $_CacheLoc )     $colFiles = $objFolder.Files     For $objFile in $colFiles         If $_ClearPasswordsAndCookies = 0 Then             If $objFile.Name <> "Current Session" And $objFile.Name <> "Current Tabs" And $objFile.Name <> "Cookies" And $objFile.Name <> "Bookmarks" And $objFile.Name <> "Preferences" And $objFile.Name <> "Web Data" Then $objFSO.DeleteFile ( $objFile )         Else             If $objFile.Name <> "Current Session" And $objFile.Name <> "Current Tabs" And $objFile.Name <> "Preferences" And $objFile.Name <> "Bookmarks" Then $objFSO.DeleteFile ( $objFile )         EndIf         If @error <> 0 Then $_DirtyFlags = 1     Next     If $objFSO.FolderExists ( $_CacheLoc & "\cache" ) Then $objFSO.deletefolder ( $_CacheLoc & "\cache" )     If @error <> 0 Then $_DirtyFlags = 1     If $_DirtyFlags = 1 Then         Msgbox ( 0, 'Error', $_Msg2, 5 )     Else         Msgbox ( 0, 'Success',  $_Msg1, 5 )     EndIf EndIf Exit

GetActiveKeyboardLayout and IME Mode

$
0
0

Hi -

I am trying to determine if there is a way programmatically to get the IME mode that your active window is using.. To explain this a little bit more here goes->

For text services and Input Language for my windows 7 computer I have Korean language and Korean Microsoft IME added.  I use Korean Microsoft IME.  The IME allows me to either type in English letters like --> abcdefg or in Hanja like this ---> 안녕, The method for switching between Han/Eng is by pressing the Right Alt key (which is hotkey builtin to windows for this function). 

 

Using the command GetActiveKeyboardLayout($hWnd) I can get the Language (which for Korean is 412). I need to figure out how to get the IME Mode (Is the application window setup to type in English(abcd) or Hanja (안녕)? I need Autoit to send keystrokes, but need to first determine what mode it is in so that it is sending the correct keystrokes.

 

I have googled this bug have not been able to come up with a solution..

Help would be greately appreciated with this ..

Thanks

 

Tray

$
0
0

Hi! Please, give me script that would hide all tray icons which appear when the script is working.

[_ImageSearch] how can i optimize this script?

$
0
0
it detects the images but it's not pressing the key instantly, i want to make it when see the image = press key asap but it's not doing it.

<snip>

Just need a little help with a script (Super newb)

$
0
0

hiya. I was using AHK and had a number of scripts working pretty well, but would like to use AutoIt instead for a few reasons.

Could someone help me get a pretty simple script working?

Its this:

#include <misc.au3> while(_ispressed(01) $pos = mousegetpos() mousemove($pos[0], $pos[1]-5) wend

After compiling it and trying to run it, it says
Line 380 (File "filelocation"):

Error: Missing right bracket ')' in expression.

 

So I guess I'm missing a right bracket, but I've no idea where to put it. I'm also not sure if the part that "while(ispressed" needs to specify the left mouse button. If so, how do I add that too?

I've tried a few things on my own and some have gotten rid of error messages, but result in the script not even running so that must of not been right. I've kind of run out of ideas and was failing to find the answer through searches so thought I'd ask here.

 

All the script should do is move the mouse while holding down left click.

Could you tell me what to do with it?

Viewing all 12506 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>