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

StatusbarGetText - crashing application

$
0
0

I try to automate some CRM application I used $sRegExpTitle to capture title.

 

When I use:

StatusbarGetText($sRegExpTitle, '', 6)

then I get correct info

 

 

When I use:

StatusbarGetText($sRegExpTitle, 'Krak', 6)

then CRM application just had a HardCrash.

 

'Krak' is a text inside one of the StatusBar "part "

 

I use _GetClasses():

https://www.autoitscript.com/wiki/Snippets_%28_AutoIt_%29#GetClasses

Local $hWnd = WinWait($sRegExpTitle, "", 10) ; Retrieve a list of all the controls in the Calculator window using the handle returned by WinWait. MsgBox(4096, "Test", _GetClasses($hWnd))

to check if there is another msctls_statusbar32 controls, but there is not.

 

 

Any concept why this example crash that application ?

 

mLipok


Convert xml or json to an array.

$
0
0

Hey,

Is there an (easy) way to convert a xml or json file to a 2D array?
I have been looking arround the forum but, by lack of srcipting talent, failed to find a solution :(

The output array should look like this (it will be more collomns with the real data set):

Id          Name 550       Name01 537       Name02 519       Name03 ...

The data to be converted comes from a rest api respons and can be xlm or json...

<UserStories>   <UserStory Id="550" Name="name01" />   <UserStory Id="537" Name="name02" />   <UserStory Id="519" Name="name03" />   <UserStory Id="516" Name="name04" />   <UserStory Id="514" Name="name05" />   <UserStory Id="512" Name="name06" />   <UserStory Id="509" Name="name07" />   <UserStory Id="469" Name="name08" />   <UserStory Id="468" Name="name09" />   <UserStory Id="442" Name="name10" />  </UserStories>
AutoIt         
{   "Items": [     {       "Id": 537,       "Name": "Name01"     },     {       "Id": 519,       "Name": "Name02"     },     {       "Id": 516,       "Name": "Name03"     },     {       "Id": 514,       "Name": "Name03"     },     {       "Id": 512,       "Name": "Name04"     },     {       "Id": 509,       "Name": "Name05"     },     {       "Id": 469,       "Name": "Name06"     },     {       "Id": 468,       "Name": "Name07"     },     {       "Id": 442,       "Name": "Name08"     },     {       "Id": 440,       "Name": "Name09"     },     {       "Id": 433,       "Name": "Name10"     },   ] }

Thanks in advance,

Simon

Help with script

$
0
0

so i wanted to edit this script because some things are not working 



zQgzju7.png

So it targets World of Warcraft as app and this should be auto join battleground script that i want to make

when you que for battleground you get a pop up and i was wondering if i can use something like this

If battleframe=true then Controlsend($windowstitle,"",0,$macrobindkey)
endif


So if the popup(battleframe) is true it will do the key to join

Is this possible to make?

Runas with @comspec

$
0
0

Hello all !

 

 

I try to make an Runas with @comspec here my code:

 

RunAs($sUserName, $sDomain, $sPassword, 0, @ComSpec & " /c copy prefs.js" @AppDataDir & "\Mozilla\Firefox\" & $IniRead & "\", "", @SW_HIDE)

 

but no copy :(

 

I can't use a #requiadmin cause i need to get the real @AppDataDir from the computer, not the @AppDataDir from the runas... and impossible to use Filecopy cause i need more rights...

Changing Func Name? Goto? Recursive?

$
0
0

Two questions;

 

This is a noob question but I'm learning and therefore not embarrassed to ask so is there any way to declare the name of a Function on the draw?  For instance if I wanted to change a variable from 1 to 2 every time a func is called and use the variable as the new func name?

Func _Change_Func_Name()     if $var=1 then $var+=1 Else $var-=1 EndIf $New_Func_Name=_Search_Bar&$frac&() EndFunc Func $New_Func_Name() Endfunc

Obviously this wont work I used it as a example of what I wanted to do but is there anything I can do similar to the affect.

 

 

 

 

And noob question two, if I call a func within a previously running func before the previously running func has ended it calls a recursive func is there any way after the new func is called to exit out of the previous recursive func?  In one of my current projects recursive func as goto is necessary and after about 4 hours of running it gets a recursive amount exceeded error.

 

 

 

I wish I had a func that could  jump into a new func and then would exit out of the previous running and not yet finished func. Shouldn't there be a Goto func for this?

IE Automation - Save file as

$
0
0

Hey all,

 

so i'm automating IE at the moment and i have a script that logs into a website and clicks a button to download a csv file however i can't figure out how to make it so it automatically saves the file in a specific location.

 

I tried InetGet but i think because it is signed into an account it doesn't work.

 

Any ideas?

Decimal errors on exact mathematical formules

$
0
0

Hi all,

i'm becoming crazy since i'm finding several errors when relating numeric expressions each others.

Example:

$var1 = 2 $var2 = 0.50 $sum = $var1 * $var2

 

Result is NOT exactly 1 but something like 1.000000000000000000123 and using round() doesn't solve.

 

Generally speaking i realize that too often simple calcs generates micro-decimals that invalid relations.

I also tried string() but with no success.

 

Is there a way to *exactly* compare numbers with no margin of errors?

 

Thanks a lot,

 

Marco

GuiCreate on previous position

$
0
0

Hey guys.

 

I think I make a mistake somewhere but I got a trouble. I have multiple screens and I would like my window created with GuiCreate to Re-open where I closed it previously.

 

Right now, the windows is always opened on my main screen and not where I moved it the previous time I executed it. I would like to use the history 's position of windows like any other window.

$Form1 = GUICreate("Filter LDAP Creator", 362, 685,-1,-1,BitOR($GUI_SS_DEFAULT_GUI, $WS_OVERLAPPEDWINDOW),$WS_EX_APPWINDOW)

Is that possible ?

 

Thanks !


Getting random file name in folder

$
0
0

Hello,

 

I'm making a script that extracts subtitles from a zip file.

I made it extract the subtitles to a random folder name. The subtitles can have a random name, 

So I need a way to get the name.

 

After I extract the zip file, I'm deleting the zip file, so there's only 1 file left in the folder that I extracted the subtitles to,

What would be the best way to grab the name?

 

Something like this?

                $aFileList = _FileListToArray(@TempDir & "\" & $random_subtitles_folder, "*")            For $i = 1 To UBound($aFileList)                         If @error = 0 Then                            MsgBox("","",$aFileList[$i], 1)                         EndIf                     Next

The above code works, but how do I return the result as a variable? 

I'd like to use it like : $subtitle_name = $aFileList[$i]

Calling all AutoIt functions from other languages?

$
0
0

I vaguely remember, there was a method or UDF for calling all AutoIt functions from other programming languages, including default and custom UDFs. Now I can't find it by any means. Initially I thought it was AutoItObject UDF but seems it is not:

 

Q. Does this mean that the objects I create are available from other programs since they're actually COM-objects? No. The objects are created at runtime and for AutoIt's eyes only.

So could someone pinpoint it to me or is my memory just a dream of a drunk horse? :)

Trying to get actual UsedRange object

$
0
0

Hello there,

 

I have a tiny problem and won't refuse the help of people more experienced than me. I'm trying to get a used range in Excel and don't like behaviour of $excel_book.ActiveSheet.UsedRange which returns used range including some formated cells with no data in them while I need a range object that encompasses all cells between first (top-left) and last (bottom-right) non-empty cells on the worksheet (of course there could be empty cells inside, but it's important not to encompass area larger than that just because some empty cell was painted at the end of the worksheet).

 

 

Create Test.xlsx and run the script from the same dir for testing purposes, I need to assign $used_range to smth that would suit the above mentioned requirement:

#include <Array.au3> #include <Excel.au3> Global $excel, $excel_file = @ScriptDir & "\Test.xlsx" Global $excel_book = _Excel_BookAttach ($excel_file) If @error Then   $excel = _Excel_Open (false, false, false, true, true)   $excel_book = _Excel_BookOpen ($excel, $excel_file) EndIf Global $used_range = $excel_book.ActiveSheet.UsedRange GLobal $used_range_data = _Excel_RangeRead ($excel_book, Default, $used_range) If @error Then MsgBox (48, "Error code:", @error) If IsObj ($excel) Then _Excel_Close ($excel) _ArrayDisplay ($used_range_data)

"text size" changed from default 100% causing GUI problems

$
0
0

Unfortunately I've found that my input boxes and combos are getting truncated if users change their text size from the default 100% by "screen resolution" -> "make text and other items larger or smaller" (or Control Panel\All Control Panel Items\Display) and selecting medium or larger. This seems to even alter how much text can be stored in the GUI fields by truncating them.

 

Is there any way I can easily set the "make it easier to read what's on your screen" setting to 100% during script execution and put it back upon close please?

Manipulate print window and spreadsheet

$
0
0

Hi all!
 
I really don't understand much of injection and manipulating windows and such. But at the same time, it should be possible. Right?
 
First of, a spreaksheet. Much like Excel but... yeah I think you get the jist already xD I wish to insert an array into it, but I do now even know how to start doing it. This is the info provided by Au3Info:

Plain Text         
>>>> Window <<<< Title: Fakturering - [Faktura : (order : )] Class: ThunderRT6MDIForm Position: -8, -8 Size: 1936, 1056 Style: 0x17CF0000 ExStyle: 0x00040100 Handle: 0x000105AC >>>> Control <<<< Class: SPR32X30_SpreadSheet Instance: 5 ClassnameNN: SPR32X30_SpreadSheet5 ID: Text: Position: 5, 187 Size: 1905, 713 ControlClick Coords: 1367, 333 Style: 0x56800000 ExStyle: 0x00000000 Handle: 0x0001066C >>>> Mouse <<<< Position: 1372, 562 Cursor ID: 0 Color: 0xFFFFFF >>>> StatusBar <<<< >>>> Visible Text <<<< Faktura : (order : ) Permanent Summa

 
 
 
 
Next, I am using a simple print window, where I'd like to;

  • Select printer from combo box (it has a specific name)
  • Type in text inside two different text boxes

The printer:

Plain Text         
>>>> Window <<<< Title: Välj skrivare Class: ThunderRT6FormDC Position: 453, 298 Size: 598, 292 Style: 0x14C80080 ExStyle: 0x00000101 Handle: 0x000A045C   >>>> Control <<<< Class: ThunderRT6ComboBox Instance: 6 ClassnameNN: ThunderRT6ComboBox6 ID: 12 Text: Position: 120, 16 Size: 201, 21 ControlClick Coords: 83, 9 Style: 0x54010243 ExStyle: 0x00000000 Handle: 0x00031152   >>>> Mouse <<<< Position: 659, 348 Cursor ID: 0 Color: 0xFFFFFF   >>>> StatusBar <<<<   >>>> Visible Text <<<< <hidden due to privacy> Välj automatiskt Nej Välj automatiskt &Ok &Avbryt Eposta     >>>> Hidden Text <<<< <hidden due to privacy>

 
TextBox1:

Plain Text         
>>>> Window <<<< Title: Välj skrivare Class: ThunderRT6FormDC Position: 453, 298 Size: 598, 292 Style: 0x14C80080 ExStyle: 0x00000101 Handle: 0x000A045C   >>>> Control <<<< Class: ThunderRT6TextBox Instance: 2 ClassnameNN: ThunderRT6TextBox2 ID: 2 Text: Position: 408, 48 Size: 169, 25 ControlClick Coords: 78, 16 Style: 0x540100C0 ExStyle: 0x00000004 Handle: 0x00030D94   >>>> Mouse <<<< Position: 942, 387 Cursor ID: 0 Color: 0xFFFFFF   >>>> StatusBar <<<<   >>>> Visible Text <<<< <hidden due to privacy> Välj automatiskt Nej Välj automatiskt &Ok &Avbryt Eposta     >>>> Hidden Text <<<< <hidden due to privacy>

 
TextBox2 is same but has instance 2 not 1.

Press key once and it repeats couple times

$
0
0

Hello. I remember back when playing WoW that people used AutoIt to help them improve their dps, when they had issues with latency.

So now im stuck with this problem myself in D3. The thing is that I need to spam 1 button to keep myself alive, and due to latency issues (300), even though I spam the hell out of the button - I still die.

So what I need is:

I press a key (lets say button "1") and the program sends it 5 times with 50ms delay. (This is to ensure that server gets my command and I will stop dying)

I've been searching all over the net and forums...still can't find what I need. But I'm sure it must be somewhere.

Can anyone help me out with this and kindly provide the script?

hi yes looking to make a script having issue first script

$
0
0

Hi yes, looking to make a script for example to add to domain, but copy a text file then paste it in for computer name but delete the text.

In long im going to make the whole script to add to domain, but when it gets to pc name open a text copy that text and delete.Since there is gona be a bunch of lines in there then paste it into where the pc name is once thats done then the next computer the script runs on it will copy the next text line in the word file since the script deleted the one it copied.

As of right now im looking to do just a copy and paste word script right now. Im having issues with just creating this function any help would be appreciated. Currently im writing this since we work on 20+ comps a day and adding them to the domain constantly is a pain would be easier to knock that out so we can do more a day. :)

 

As of right now i dont have anything solid yet since im just starting on it i was just looking for some pointers or lines that can point me in the right direction for making a script to open the text file copying then pasting to "Blank destination" maybe another text file for testing purposes for right now.


Need Help with a Simple Script

$
0
0

Hi all,

 

I was wondering if I could get some help with some scripting please.

Basically I want to automate something in a game (already launched), and keep looping it.

 

I want something that goes like this:

1) Mouse over to a certain cooardinate in the game (let's say X1, Y1).

2) Hold "Alt" key and click on the left mouse button. (Perhaps step 1 and 2 can be combined, right?)

3) Wait 1 second ("Sleep" function, right)?

4) Type in a certain integer (let's say 10).

5) Wait 1 second

6) Mouse over to another coordinate, and left click.

 

I want to loop this, until certain period, or when I cancel it manually.

Any help is appreciated.

Thanks!!

 

Regards,

Jijou

join 2 ie windows into 1 with 2 tabs

$
0
0

I have no idea how to do this, or where to start.

 

I have a script that launches my local intranet website, logs me in, then I minimize it

 

I then launch another script that launches our company's Symantec Endpoint manager logs me in, ( I do my normal checking to make sure no computers have any virus..ect ect)

 

from there I have 2 windows of ie open, and what I do is I grab the tab of one window, and drag it to the other instance of the other window so I only have 1 ie window with 2 tabs.

 

my question is, or is it possible to join the 2 windows into 1 with 2 tabs?

Change ListView row font color

$
0
0

I'm trying to make it so anything in a row that has a specific column 5 value will show up with red font. Here is a small snippet.

For $z = 0 To (UBound($MetadataDB2)) - 1     _GUICtrlListView_AddItem($FoundAccountBox, $MetadataDB2[$z][5], 0)     _GUICtrlListView_AddSubItem($FoundAccountBox, $z, $MetadataDB2[$z][0], 1, 1)     _GUICtrlListView_AddSubItem($FoundAccountBox, $z, $MetadataDB2[$z][1] & " to " & $MetadataDB2[$z][2], 2, 2)     _GUICtrlListView_AddSubItem($FoundAccountBox, $z, $MetadataDB2[$z][3], 3, 3)     If $MetadataDB2[$z][5] <> 0 Then         MsgBox(0,"","COLOR CHANGE DAMNIT"&@CRLF&$MetadataDB2[$z][5])             EndIf Next

The message box kicks up for ever time the field is blank, but I don't really know what command will change just a single rows font color. I've been looking at this article:

http://www.autoitscript.com/forum/topic/89654-listview-for-every-subitem-set-color-backcol-and-font/

 

But I cannot seem to figure out how to actually change the font color... Anyone have tips?

wingettitle help

$
0
0

is it possible to get the first characters of the active workbook?

i got the active excel title but its giving a value book1 - excel, I just want to get the first 5 charcters in the title... thanks

#include <MsgBoxConstants.au3> HotKeySet("{F1}", "Example") Func Example()     ; Retrieve the window title of the active window.     Local $sText = WinGetTitle("[ACTIVE]")     ; Display the window title.     MsgBox($MB_SYSTEMMODAL, "", $sText) EndFunc   ;==>Example While 1     Sleep(10) WEnd

Problems using autoit with internet explorer

$
0
0

Dear Autoit Community,

 

Thank you for taking the time to read my first post.

 

I understand how to use _IECreate  and how to use objects to manipulate the named webpage in the code.

 

But what if I am redirected to open another webpage that I cannot access directly? For example, if the named webpage in the code  has a redirect instruction,  it may take me to a different page. How do I tell autoit that i now want it to focus on the new webpage that I haven't included in the original code--and to accept instructions?

 

Regards

 

Greg

 

Viewing all 12506 articles
Browse latest View live


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