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

Can't Find ControlID for Inbut Box

$
0
0

Is there anything I can do (other than XY) to target the input box "Sample Name"

 

The area in the blue is the area that I selected (I could not specify any further than that).

 

K1WokEL.jpg

 

Here is a summary of that info:

Plain Text         
>>>> Window <<<< Title:  (METTLER) - TGA-200A with gas box Class:  Afx:00400000:0 Position:   -8, -8 Size:   1696, 1066 Style:  0x15CFC000 ExStyle:    0x00000100 Handle: 0x00010378 >>>> Control <<<< Class:  Button Instance:   13 ClassnameNN:    Button13 Name:   Advanced (Class):   [CLASS:Button; INSTANCE:13] ID: Text:   Sample Position:   331, 221 Size:   513, 148 ControlClick Coords:    211, 55 Style:  0x50000007 ExStyle:    0x00000004 Handle: 0x00010434 >>>> Mouse <<<< Position:   542, 318 Cursor ID:  0 Color:  0xDBFFFF >>>> StatusBar <<<< 1:  For help, press F1 2:  STARe Default DB V10.00: METTLER 3:    4:  5:  NUM 6:  >>>> ToolsBar <<<< >>>> Visible Text <<<< New Open... Modify... Signatures... Run Blank Curve TGA-200_2057-79-64_APS_WWControl 0.0000 105 Remove Pan Lid Send Experiment Help TGA-200 C6_general zeolite v2 Sample Name Weight Position Sample Preparation: Pan: Segments Info: Alumina 70ul (0.00 - 5000.00)

????

 

Thanks AUTOIT Community!

 

Tim


Better way of doing tree view

$
0
0

I'm working on a tree view trying to figure out this bug I have run into, and also to see if there is a less intense way of doing this. I've included 2 sample arrays to play with. The first array does not process the way I want it to because of repetition in columns 5 and 6. I have been trying to figure out how to make this show up correctly for either example.

 

The other problem is that these arrays are small (only a couple dozen records) in comparison to the overall array I'm trying to process and it takes about 7 minutes to process the full array.

 

Can someone point me in the right direction?

AutoIt         
#include <GUIConstantsEx.au3> #include <TreeViewConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <GuiTreeView.au3> Local $Test[27][6]=[['Field1','ABC','','XYZ','Testing',''], _ ['Field1','ABC','','XYZ','Testing2',''], _ ['Field1','ABC','','XYZ','Testing3',''], _ ['Field1','ABC','','ZYX','Testing',''], _ ['Field1','ABC','','ZYX','Testing2',''], _ ['Field1','ABC','','ZYX','Testing3',''], _ ['Field1','ABC','','CBA','Testing',''], _ ['Field1','ABC','','CBA','Testing2',''], _ ['Field1','ABC','','CBA','Testing3',''], _ ['Field1','ABC','','XYZ','Testing','SubTesting1'], _ ['Field1','ABC','','XYZ','Testing2','SubTesting2'], _ ['Field1','ABC','','XYZ','Testing2','SubTesting3'], _ ['Field1','ABC','','XYZ','Testing2','SubTesting4'], _ ['Field1','ABC','','XYZ','Testing3','SubTesting5'], _ ['Field1','ABC','','XYZ','Testing3','SubTesting6'], _ ['Field1','ABC','','ZYX','Testing','SubTesting1'], _ ['Field1','ABC','','ZYX','Testing2','SubTesting2'], _ ['Field1','ABC','','ZYX','Testing2','SubTesting3'], _ ['Field1','ABC','','ZYX','Testing2','SubTesting4'], _ ['Field1','ABC','','ZYX','Testing3','SubTesting5'], _ ['Field1','ABC','','ZYX','Testing3','SubTesting6'], _ ['Field1','ABC','','CBA','Testing','SubTesting1'], _ ['Field1','ABC','','CBA','Testing2','SubTesting2'], _ ['Field1','ABC','','CBA','Testing2','SubTesting3'], _ ['Field1','ABC','','CBA','Testing2','SubTesting4'], _ ['Field1','ABC','','CBA','Testing3','SubTesting5'], _ ['Field1','ABC','','CBA','Testing3','SubTesting6']] Local $Test2[20][6]=[['Field1','ABC','','XYZ','Testing',''], _ ['Field1','ABC','','XYZ','Testing2',''], _ ['Field1','ABC','','XYZ','Testing3',''], _ ['Field1','ABC','','ZYX','ZYX',''], _ ['Field1','ABC','','CBA','Testing4',''], _ ['Field1','ABC','','LMN','Testing5',''], _ ['Field1','ABC','','LMN','Testing6',''], _ ['Field1','ABC','','XYZ','Testing','Subtesting1'], _ ['Field1','ABC','','XYZ','Testing','Testing'], _ ['Field1','ABC','','XYZ','Testing2','SubTesting2'], _ ['Field1','ABC','','XYZ','Testing2','SubTesting3'], _ ['Field1','ABC','','XYZ','Testing3','SubTesting4'], _ ['Field1','ABC','','XYZ','Testing3','SubTesting5'], _ ['Field1','ABC','','ZYX','ZYX','SubTesting6'], _ ['Field1','ABC','','ZYX','ZYX','Testing'], _ ['Field1','ABC','','CBA','Testing4','CBA'], _ ['Field1','ABC','','CBA','Testing4','SubTesting7'], _ ['Field1','ABC','','LMN','Testing5','SubTesting8'], _ ['Field1','ABC','','LMN','Testing5','SubTesting9'], _ ['Field1','ABC','','LMN','Testing6','Testing6']] $Form1 = GUICreate("Form1", 616, 483, 192, 114) $idTreeView_1 = GUICtrlCreateTreeView(8, 8, 601, 433,-1, $WS_EX_CLIENTEDGE) $Button1 = GUICtrlCreateButton("Refresh1", 400, 448, 75, 25) $Button2 = GUICtrlCreateButton("Refresh2", 500, 448, 75, 25) GUISetState(@SW_SHOW) While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit         Case $Button1             RefreshProcess($idTreeView_1,$Test)         Case $Button2             RefreshProcess($idTreeView_1,$Test2)     EndSwitch WEnd Func RefreshProcess($hTreeView_1,$test='')     _GUICtrlTreeView_DeleteAll($hTreeView_1)     _GUICtrlTreeView_BeginUpdate($hTreeView_1)     $Loop=$test     $Loop2=_ArrayUnique($Loop,0,1)     $Loop3=_ArrayUnique($Loop,1,1)     $Loop4=_ArrayUnique($Loop,2,1)     $Loop5=_ArrayUnique($Loop,3,1)     $Loop6=_ArrayUnique($Loop,4,1)     $Loop7=_ArrayUnique($Loop,5,1)     If UBound($Loop7) >1 AND IsArray(_ArrayFindAll($Loop7,"")) then _ArrayDelete($Loop7,_ArrayFindAll($Loop7,"")[0])     $hParent = 0     For $z=1 to UBound($Loop2) - 1         $hParent = _GUICtrlTreeView_Add( $hTreeView_1, $hParent, $Loop2[$z],0,0)         For $x=1 to UBound($Loop3)-1             If $Loop[_ArraySearch($Loop,$Loop3[$x])][0] = $Loop2[$z] Then                 $hParent2 = _GUICtrlTreeView_AddChild( $hTreeView_1, $hParent, $Loop3[$x],1,1)                 For $w=1 to UBound($Loop4)-1                     If $Loop[_ArraySearch($Loop,$Loop4[$w])][1] = $Loop3[$x] AND $Loop[_ArraySearch($Loop,$Loop3[$x])][0] = $Loop2[$z] Then                         If $Loop4[$w] <> '' Then                             $hParent3 = _GUICtrlTreeView_AddChild( $hTreeView_1, $hParent2, $Loop4[$w],2,2)                             For $y=1 to UBound($Loop5)-1                                 If $Loop[_ArraySearch($Loop,$Loop5[$y])][2] = $Loop4[$w] AND $Loop[_ArraySearch($Loop,$Loop3[$x])][0] = $Loop2[$z] Then                                     $hParent4 = _GUICtrlTreeView_AddChild( $hTreeView_1, $hParent3, $Loop5[$y],3,3)                                     For $n=1 to UBound($Loop6)-1                                         If $Loop[_ArraySearch($Loop,$Loop6[$n])][3] = $Loop5[$y] AND $Loop[_ArraySearch($Loop,$Loop3[$x])][0] = $Loop2[$z] Then                                             $hParent5 = _GUICtrlTreeView_AddChild( $hTreeView_1, $hParent4, $Loop6[$n],4,4)                                             For $v=1 to UBound($Loop7)-1                                                 If $Loop[_ArraySearch($Loop,$Loop7[$v])][4] = $Loop6[$n] Then                                                     $hParent6 = _GUICtrlTreeView_AddChild( $hTreeView_1, $hParent5, $Loop7[$v],5,5)                                                 EndIf                                             Next                                         EndIf                                     Next                                 EndIf                             Next                         Else                             For $y=1 to UBound($Loop5)-1                                 If $Loop[_ArraySearch($Loop,$Loop5[$y])][1] = $Loop3[$x] AND $Loop[_ArraySearch($Loop,$Loop3[$x])][0] = $Loop2[$z] Then                                     $hParent4 = _GUICtrlTreeView_AddChild( $hTreeView_1, $hParent2, $Loop5[$y],3,3)                                     For $n=1 to UBound($Loop6)-1                                         If $Loop[_ArraySearch($Loop,$Loop6[$n])][3] = $Loop5[$y] AND $Loop[_ArraySearch($Loop,$Loop3[$x])][0] = $Loop2[$z] AND $Loop[_ArraySearch($Loop,$Loop3[$x])][1] = $Loop3[$x] Then                                             $hParent5 = _GUICtrlTreeView_AddChild( $hTreeView_1, $hParent4, $Loop6[$n],4,4)                                             For $v=1 to UBound($Loop7)-1                                                 If $Loop[_ArraySearch($Loop,$Loop7[$v])][4] = $Loop6[$n] Then                                                     $hParent6 = _GUICtrlTreeView_AddChild( $hTreeView_1, $hParent5, $Loop7[$v],5,5)                                                 EndIf                                             Next                                         EndIf                                     Next                                 EndIf                             Next                         EndIf                     EndIf                 Next             EndIf         Next     Next     _GUICtrlTreeView_EndUpdate($hTreeView_1) EndFunc

Note: The master does include lines that do not have a blank column 3 and I dont want a blank in the treeview I'm using the Else statement... The other part seems to work without issue.

Fix Logic - Need Pause with OK to Continue Script and Such....

$
0
0

Okay, here are the order of operations for how this script is suppose to function:

 

Step 1: Manual input
Step 2: Manual input
BEGIN PROGRAM
Step 3: Text to input box
Step 4: Press button --> then pause 3 seconds
Step 5: Halt program until a dialogue box with an "Okay to Continue" button is pressed. This allows the user to make modifications to the target application if needed....
Step 6: Repeat steps 3-5 until done with array
 

Here is the current code:

AutoIt         
#cs Solution to that is to move the window to the same screen location every time the program is run or the loop recycles. Or test to see if it's on the X/Y you want and if not, force it there. Use this as example for input box field when testing submition: http://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_legend #ce #include <file.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <GuiListView.au3> #include <Array.au3> Global $a_csv Global $listview Global $checkboxName Global $iCount Global $runProg Global $acheck Global $mapColumn global $runProg $s_Path = FileOpenDialog("Select CVS File", @ScriptDir, "comma seperated values (*.csv)") If @error Then     MsgBox(4096, "", "No File(s) chosen")     Exit Else     _FileReadToArray($s_Path, $a_csv)     buildGUI() EndIf Func copyToInput()     $allRows =  _GUICtrlListView_GetItemCount($listview)     For $rows = 0 to $allRows-1         $material_name = _GUICtrlListView_GetItem($listview, $rows, 0)         $letter = _GUICtrlListView_GetItem($listview, $rows, 3)         ;where to input if statement so only checkbox that is checked runs????         If GUICtrlRead($aCheck[1]) <> 1 and GUICtrlRead($aCheck[4]) <> 1 then continueloop         If GUICtrlRead($aCheck[1]) = 1 Then         controlsettext("HPOV", "", 4, $material_name[3])         endif         If GUICtrlRead($aCheck[4]) = 1 Then         controlsettext("HPOV", "", 5, $letter[3])         endif         controlclick("HPOV", "", 6)  Sleep(2000)         ;there you can put some sleep(5000) = 5seconds, more or less, if u know exact applications processing time for this operation         ;or ControlGetText("Myapplication title", "", CONTROL_WHICH_CHANGES_AFTER_BUTTONPRESS) and compare to older reads         controlclick("Job", "", 2)  Sleep(2000)         ;there you can put some sleep(5000) = 5seconds, more or less, if u know exact applications processing time for this operation         ;or ControlGetText("Myapplication title", "", CONTROL_WHICH_CHANGES_AFTER_BUTTONPRESS) and compare to older reads     Next EndFunc Func buildGUI()     GUICreate("CSV Listview", 900, 450, -1, -1)     $listview = GUICtrlCreateListView(StringReplace($a_csv[1], ",", "|"), 10, 10, 600, 210)     $checkboxName = StringSplit($a_csv[1], ",")     $iCount = $checkboxName[0]     ;creating buttons     Global $aCheck[$iCount + 1]     Global $mapColumn[$iCount + 1]     $nextSample = GUICtrlCreateButton("Map sample submition button ", 395, 320, 180, 30)     $runProg = GUICtrlCreateButton("Run Program", 700, 250, 180, 30)     GUICtrlSetState($runProg, $GUI_DISABLE)     $btnStop = GUICtrlCreateButton("Stop", 700, 400, 180, 30)      For $j = 1 To $iCount         ; Store controIDs of the checkboxes         $aCheck[$j] = GUICtrlCreateCheckbox($checkboxName[$j], 10, 190 + (50 * $j), 100, 30)         $mapColumn[$j] = GUICtrlCreateButton("Map " & '"'  & $checkboxName[$j] & '"' & " to input box", 150, 190 + (50 * $j), 180, 30)         GUICtrlSetState($aCheck[$j], $GUI_UNCHECKED)         GUICtrlSetState($mapColumn[$j], $GUI_DISABLE)             Next     For $i = 2 To UBound($a_csv) - 1         $s_temp = StringReplace($a_csv[$i], ",", "|")         GUICtrlCreateListViewItem($s_temp, $listview)     Next     Global $aOut['']['']     For $i = 2 to $a_csv[0]         $aLine = stringsplit($a_csv[$i] , ",",3)             If ubound($aLine) > ubound($aOut , 2) Then redim $aOut[$i][ubound($aLine)]             _ArrayAdd($aOut , $a_csv[$i] , 0 , ",")             ;consolewrite("line: "  & $aLine[2] & @LF)     Next     GUISetState()         While 1             $msg = GUIGetMsg()             Switch $msg                 Case $GUI_EVENT_CLOSE                     ExitLoop                 Case $runProg                     copyToInput()                 Case Else                     For $i = 1 To $iCount                         If $msg = $aCheck[$i] Then                             If GUICtrlRead($msg) = 1 Then                                 GUICtrlSetState($mapColumn[$i], $GUI_ENABLE)                                 GUICtrlSetState($runProg, $GUI_ENABLE)                                 Local $text = ""                                 For $k = 0 to $a_csv[0]-1                                   $text &= ControlListView ("CSV Listview", "", $listview, "GetText", $k, $i-1) & @crlf                                 Next                                 ;Msgbox(0,$checkboxName[$i], $text) ; debug, can see the list of samples you selected                             Else                                 GUICtrlSetState($mapColumn[$i], $GUI_DISABLE)                             EndIf                             ExitLoop                         EndIf                     Next             EndSwitch     WEnd EndFunc

Where are you Zobengrauzis? :sorcerer:

 

Tim

make a variable of part of url

$
0
0

hello!

I need some help with this: i have this url http://nos.nl/teletekst#801and the 801 is a variable i want my script to read. how can i do this?

i hope someone can help me!

Populating Arrays from Excel

$
0
0

Hi all,
 
I am working on a data entry utility to enter large amounts of data into a piece of software. My data lives in a series of excel spreadsheets each with 6 columns and 100 rows (the software into which I'm entering my data has a limit of 100 rows per entry).
 
I'm having a hard time getting my arrays to populate with data from Excel. Here's what I've got set up:

  1. ;; Populate arrays with CDM charge info from excel doc
  2. Local $oExcel = _Excel_Open()
  3. Local $oWorkbook = _Excel_BookOpen($oExcel,@DesktopDir & "\AutoItTest.xlsx")
  4. Sleep(2000)
  5.  
  6. Local $aProcedure = _Excel_RangeRead($oExcel,Default,$oWorkbook.ActiveSheet.Usedrange.Columns("A:A"),1)

I then repeat this for each of my other 5 columns of data.

 

Based on the information in Help, I take this to populate my $aProcedure array with all of the contents in column A.

 

Please help! Thank you!

check RequireAdmin

$
0
0
quoting the help file about #RequireAdmin:
 
"In case system doesn't have elevation mechanism (e.g. disabled UAC) new process will run under the same user as the original."
 
just to be clear about correct\none-correct cases regarding #RequireAdmin:
 
1. if the user is running under a disabled UAC, he wont be able to run as another user with admin rights ?
 
2. using #RequireAdmin and a disabled UAC wont give any message that user hasn't got admin privileges to run.., but then the script continue's (the script needs a routine to figure this out) ?
 
thanks

Check if a 2D array is still an array

$
0
0

woop woop, im a dummy, please delete

Screen Capturing Inquiry

$
0
0

Good day to all :)

 

So I am new to programming and to this application. I have written a script for a small toolbar/app launcher for the department I work in to centralize the copious amounts of applications our phone reps have to use.

 

I have added a screen capturing button that when they click it, it snaps a screen shot of their screens.

 

I can get the _ScreenCapture_Capture to work but it doesn't take just one screen shot it. It keeps taking them until you exit out of the program.

 

I then decided to change it to _ScreenCapture_Saveimage function to save the shot to the desktop but am getting "error: Incorrect number of parameters in function call.

 

Not sure what I'm leaving out but any help would be greatly appreciated. Please see script below:

AutoIt         
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <INet.au3> #include <IE.au3> #include <Word.au3> #include <excel.au3> #include <ScreenCapture.au3> opt("MustDeclareVar" , 1) MainGUI() ;Name the Variables Func MainGUI()     Global $SeondaryGUI ,  $Page2 , $hBmp , $Screen , $mygui , $newmsg , $Label3 , $Submit , $Edit , $Amysis , $CareManager , $CSA , $HealthX , $Kronos , $Google , $NCR , $NICEPerform , $NICEWFM , $MP , $ReportManager , $RXCLAIM     Global  $RxPortal , $ie , $Calc , $Password ,$IE , $Button14 , $HFHPAPP , $Button16 , $Label1 , $Label2 ,$Notepad , $Word , $Excel , $Groupwise, $Messenger , $HFlogo , $Button21 , $Pic1 , $CSapps , $msg ;Create the main GUI $mygui = GUICreate("Customer Service Launcher", 514, 711, 258, 173) GUISetCursor (2) GUISetFont(10, 800, 0, "MS Sans Serif") GUISetBkColor(0xA6CAF0) $secondGUI = GUICreate("Customer Service Launcher", 514, 711, 258, 173) GUISetCursor (2) GUISetFont(10, 800, 0, "MS Sans Serif") GUISetBkColor(0xA6CAF0) ;Assign the Variables $Amysis = GUICtrlCreateButton("Amysis", 16, 72, 139, 25) $CareManager = GUICtrlCreateButton("Care Manager", 16, 104, 139, 25) $CSA = GUICtrlCreateButton("CSA", 16, 136, 139, 25) $HealthX = GUICtrlCreateButton("Health X", 16, 168, 139, 25) $Kronos = GUICtrlCreateButton("Kronos", 16, 200, 139, 25) $Google = GUICtrlCreateButton("Google", 16, 232, 139, 25) $NCR = GUICtrlCreateButton("NCR", 16, 264, 139, 25) $NICEPerform = GUICtrlCreateButton("NICE Perform", 16, 296, 139, 25) $NICEWFM = GUICtrlCreateButton("NICE WFM ", 16, 328, 139, 25) $MP = GUICtrlCreateButton("Market Prominence", 16, 360, 139, 25) $ReportManager = GUICtrlCreateButton("Report Manager", 16, 392, 139, 25) $RXCLAIM = GUICtrlCreateButton("Rx Claim", 16, 424, 139, 25) $IE = GUICtrlCreateButton("Internet Explorer", 16, 552, 139, 25) $Dashboard = GUICtrlCreateButton("Dashboard", 16, 488, 139, 25) $HFHPAPP = GUICtrlCreateButton("HP App page", 16, 520, 139, 25) $Screen = GUICtrlCreatePic("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\Camera.jpg", 176, 288, 100, 60) $RxPortal = GUICtrlCreateButton("RxPortal", 16, 456, 139, 25) $Calc = GUICtrlCreateButton("Calculator", 192, 232, 83, 25) $Label1 = GUICtrlCreateLabel("Applications", 8, 32, 141, 29) GUICtrlSetFont(-1, 18, 800, 2, "Modern No. 20") $Label2 = GUICtrlCreateLabel("Tools", 200, 32, 62, 29) GUICtrlSetFont(-1, 18, 800, 2, "Modern No. 20") $Notepad = GUICtrlCreateButton("Notepad", 192, 72, 83, 25) $Word = GUICtrlCreateButton("Word", 192, 104, 83, 25) $Excel = GUICtrlCreateButton("Excel", 192, 136, 83, 25) $Groupwise = GUICtrlCreateButton("Groupwise", 192, 168, 83, 25) $HFlogo = GUICtrlCreatePic("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\HF logo.jpg", 288, 10, 180, 60) $Messenger = GUICtrlCreateButton("Messenger", 192, 200, 83, 25) $calendar = GUICtrlCreateMonthCal ("Calendar", 192 , 520 , 292 , 172 ) $Edit1 = GUICtrlCreateEdit("", 288, 72, 217, 353) GUICtrlSetData(-1, "Notes:") $Page2 = GUICtrlCreateButton("Page 2", 288, 432, 211, 57) $Password = GUICtrlCreatePic ("S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Images\word.jpg" , 24 , 624 , 116 , 76) $Label3 = GUICtrlCreateLabel("Password Keeper", 24, 605, 136, 22) GUISetState() ;Run the gui until window is closed While 1     $msg = GUIGetMsg()         Select     Case $msg = $GUI_EVENT_CLOSE         exit     Case $msg = $Notepad         Run ("notepad.exe")     Case $msg = $Calc         Run ("calc.exe")     Case $msg = $Amysis         ShellExecute ("http://hfhp-wcaa.dstcorp.net:8080/amisys-web/Controller?view=jsp/Pportal.jsp")     Case $msg = $CareManager         ShellExecute("https://apps-hfhp.healthedge.net/Citrix/XenApp/hfhp/auth/login.aspx")     Case $msg = $CSA         ShellExecute("http://hfhp-wccsa.dstcorp.net:8080/hfhp-PROD-csa/portal")     Case $msg = $HealthX         ShellExecute("https://secure.healthx.com/publicservice/loginv1/login.aspx?bc=c1503d12-e5a7-43ba-8dc8-4ce5cfc2b5e1&serviceid=8d6ab51b-6c4c-4735-a738-87341c01f849")     Case $msg = $Kronos         ShellExecute("http://hfvkron.health-first.org/wfc/logon/logonWFC.html")     Case $msg = $Google         ShellExecute ("https://www.google.com/?gws_rd=ssl")     Case $msg = $NCR         ShellExecute("http://hfepsprod1.priv.health-first.org/CVMEServer/Login.aspx")     Case $msg = $NICEPerform         ShellExecute("http://hfniceim1/NiceApplications/Desktop/WebPage/DeskTopWebForm.aspx")     Case $msg = $NICEWFM         ShellExecute("http://101.202.40.3/agent/")     Case $msg = $MP         run ("MPC4Cunlock.exe")     Case $msg = $ReportManager         ShellExecute("http://hfhpsql12p01.priv.health-first.org/Reports/Pages/Folder.aspx")     Case $msg = $RXCLAIM         ShellExecute("https://asp.rxclaim.catamaranrx.com/RxClaim.html")        Case $msg = $IE         ShellExecute("http://intranet.health-first.org/")     Case $msg = $HFHPAPP         ShellExecute("http://intranet.health-first.org/departments/health_plans/apps/index.cfm")     Case $msg = $Word             $Word = _WordCreate (@ScriptDir & "\Test.doc", 1) ; Check @extended return value to see if attach was successful If @extended Then     MsgBox(0, "", "Attached to Existing Window") Else     MsgBox(0, "", "Created New Window") EndIf     Case $msg = $Excel             $Excel = _ExcelBookNew()     Case $msg = $Groupwise         Run("grpwise.exe")      Case $msg = $Messenger         run("C:\Program Files (x86)\Novell\Messenger\NMCL32.exe")     Case $msg = $Dashboard         ShellExecute("https://10.8.3.27:8444/cuic/permalink/PermalinkViewer.htmx?viewId=B194CB921000013A02102C0A0A08031B&linkType=dashboard&uuid=9315d5a3-c745-406a-8ad9-43b27dc55749")     Case $msg = $Password         ShellExecute( "S:\Health Plans\Operations\RYANB\UBER\CS App Launcher\Files\BLANK Password Keeper.doc")     Case $msg = $HFlogo         ShellExecute ("https://www.youtube.com/watch?v=9cQgQIMlwWw")     Case $msg = $Screen         $Screen = _ScreenCapture_SaveImage(@DesktopDir & "\new_screenshot.jpg")     Case $msg = $RxPortal         ShellExecute("https://healthfirsttrain.rxportal.sxc.com/rxclaim/portal/memberLogin")     Case $msg = $Page2             EndSelect     WEnd     EndFunc

Change volume of another process

$
0
0

Hi, I am trying to set the volume of another process but with no luck. I have looked a bit in the help file and found

SoundSetVolume

But that clearly only changes the current process(or every process not quite sure) But what I want is to change the volume of one process as said.

 

I have googled and searched a bit on the forum and I can't seem to find anything that work. I Tried looking at controlsend/click to the windows 7 volume mixer, but this seems like a wierd way to do it? I would also like to retrieve the current volume of the process.

 

 

 

I would appericiate if you could give me a few hints/ the soulution to how this is possible in another way than controlsend/click?

Make Send command faster than 10ms

$
0
0

I'm using AutoIT for some high precision button mashing in C# and am wonder if it'd be possible to have the Send command be faster? I've clocked it to about 10ms per Send command.

 

10ms is a good speed but I'm not just mashing one button, I'm mashing at least 4 and the overall speed goes down to 40ms per key which is pretty bad. I multi-threaded my project, increased timer precision but it's being held down by the Send command's execution time.

 

I made an identical program in Obj-C using Apple native libraries and I can get button mashing down to half a millisecond latency.

 

How can I decrease the Send command latency in AutoIT?

 

 

 

Thanks,

Gan

 

P.S. Here's my code if you fellas would like to gander: https://github.com/MatthewFrench/LeagueAutoKeyPresser

Excel Data Connections are not refreshed opening with Autoit

$
0
0

Opening my Excel file through Autoit doesn't cause the data connections to be refreshed, which would be the case if I manually open the file. I tried to find a solution but after one day of struggling I changed strategy: Now I let Window's Task scheduler open the file, which then is updated correctly. My idea then was to schedule the compiled AutoIt script 5 minutes later in order to do the operations on that file. But this doesn't work, as I probably do not address well AutoIt to the by then already opened excel file.

 

Very strange: if I manually open the excel file and then launch the script (or manually or scheduled) all operations are executed correctly. If I launch the excel spreadsheet with the task scheduler this is not working.

 

I guess I'm missing something. The most logic way would be to do everything in one script but then I have to force the data connection to be updated on the opening of that file...

 

Anybody has a hint or an example?

Martin

Random number read and type?

$
0
0

http://tinypic.com/r/15xadk0/8 <--- link to image If that one doesn't work try this http://tinypic.com/r/15xadk0/8

 

So as you can see I made a small example in paint here's what i'd like some help with.  So as you see it says "2 digit random number generated" I want it to read that number and then move to the box for typing click and write the random number that appeared then press okay.  I do know how to set it by desktop coordinates to move to the okay button and the box but help with that to would be appreciated.  Thanks I really appreciate it!!!!!!!! :thumbsup:  :bye:

Exit not working?

$
0
0
HotKeySet("{Esc]","Terminate")
 
While 1
Sleep (200)
WEnd
 
Func Terminate()
   Exit
EndFunc
 
Just trying to code simple exit not sure whats wrong?

GUICtrlListView_AddSubItem Bug? (error when looping)

$
0
0

Trying to make a loop to populate a list view... this code is straight from the help file just made a while loop instead of hard coding values - it works with _GUICtrlListView_AddItem however nothing shows on _GUICtrlListView_AddSubItem

AutoIt         
#include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> Example() Func Example()     Local $hImage, $hListView     ; Create GUI     GUICreate("ListView Add SubItem", 400, 300)     $hListView = GUICtrlCreateListView("", 2, 2, 394, 268, -1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES))     GUISetState(@SW_SHOW)     ; Add columns     _GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)     _GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)     _GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100)     ; Add items THIS IS THE CHANGE       For $i = 1 To 50          ConsoleWrite("i: " & $i & @CRLF)           _GUICtrlListView_AddItem($hListView, "Row " & $i & ": Col 1", $i)           _GUICtrlListView_AddSubItem($hListView, $i, "Row " & $i & ": Col 2", 1, 1)           _GUICtrlListView_AddSubItem($hListView, $i, "Row " & $i & ": Col 3", 2, 2)       Next     ; Loop until the user exits.     Do     Until GUIGetMsg() = $GUI_EVENT_CLOSE     GUIDelete() EndFunc   ;==>Example

Example straight from help file:

 

https://www.autoitscript.com/autoit3/docs/libfunctions/_GUICtrlListView_AddSubItem.htm

 

 

*Problem* Select Loops Duping GUIs *Problem*

$
0
0

Hello Everyone :bye: ,

My name is Will and I have used AutoIt for quite some time now to make mini apps for myself such as Video Game Bibles(Game Encyclopedias), Desktop/Folder Locks and other goofy projects. I am currently working on a little "reminder" project to keep things in mind since my memory is very selective :sweating: . So to get to my point I am having trouble with swapping GUIs when using a Select Loop nested inside of a While Loop. I have one GUI create initially and then the loop begins. It waits for buttons to be pressed but after adding the Btn_Min (Button to Minimize) Case things get screwy. After adding this Case then running my program the GUI is created/deleted infinitely. Now I do have the function to create the other GUI deleting the current one which is why the GUIs do not pile up but rather re-create. I have searched a bit to find out if there have been similar issues but I have not been able to find anything on it (probably because I don't know exactly what to search) but if anyone could point me in the correct direction it would be much appreciated! :)

 

Here is my script:

(Lines 28 & 29 are commented out. Those are the ones that cause the issue. Can press ESC Button for an emergency exit)

AutoIt         
  1. ;Includes
  2. #include <GUIConstantsEx.au3>
  3.  
  4. ;HotKeys
  5. HotKeySet("{ESC}", "QUIT")
  6.  
  7. ;Globals:
  8. Global $WinWid = 600, $WinHgt = 250, $WinWidMin = 100, $WinHgtMin = 15
  9. Global $WinMinX = @DesktopWidth - ($WinWidMin + 50), $WinMinY = @DesktopHeight - ($WinHgtMin + 100)
  10. Global $WinX = @DesktopWidth - ($WinWid + 50), $WinY = @DesktopHeight - ($WinHgt + 100)
  11. Global $Min_Win, $Btn_Max, $Max_Win, $Btn_Min
  12.  
  13. ;Start Program
  14. Mini_Calender()
  15.  
  16. ;Create Start Window & Main Function
  17. Func Mini_Calender()
  18.  
  19.    Min_Win() ;Runs Min_Win() Function (Creates Mini Window)
  20.  
  21.    While 1 ;Begins While Loop
  22.  
  23.       $msg = GUIGetMsg() ;Watches GUI Events
  24.  
  25.       Select ;Begins Select Loop
  26.       Case $msg = $Btn_Max ;If Max(<) Button Pressed
  27.          Max_Win() ;Runs Max_Win() Function (Creates Full Window)
  28. ;     Case $msg = $Btn_Min ;If Min(>) Button Pressed
  29. ;        Min_Win() ;Runs Min_Win() Function (Creates Mini Window)
  30.       Case $msg = $GUI_EVENT_CLOSE ;If Close(X) Button Pressed
  31.          Exit ;Close Program
  32.       EndSelect ;Ends Select Loop
  33.  
  34.    WEnd ;Ends While Loops
  35.  
  36.  
  37. ;Creates Mini Window
  38. Func Min_Win()
  39.    GUIDelete() ;Deletes Current GUI Window
  40.    $Min_Win = GUICreate("Mini Calender", $WinWidMin, $WinHgtMin, $WinMinX, $WinMinY) ;Creates Mini Window
  41.    $Btn_Max = GUICtrlCreateButton("<", 25, 0, 50, 15) ;Creates Max Button
  42.    GUISetState(@SW_SHOW) ;Makes GUI Window Visible
  43.  
  44. ;Creates Max Window
  45. Func Max_Win()
  46.    GUIDelete() ;Deletes Current GUI Window
  47.    $Max_Win = GUICreate("Mini Calender", $WinWid, $WinHgt, $WinX, $WinY) ;Creates Max Window
  48.    $Btn_Min = GUICtrlCreateButton(">", $WinWid - 75, $WinHgt - 16, 50, 15) ;Creates Min Button
  49.    GUISetState(@SW_SHOW) ;Makes GUI Window Visible
  50.  
  51. ;Emergency Exit (ESC Key)
  52. Func QUIT()
  53.    Exit ;Exits The Program

If you have any questions please ask me and I will do my best to answer.


_GUICtrlListView_GetItemText not working with variable

$
0
0

_GUICtrlListView_GetItemText seems to return data when I use a static indices but when i use it from a variable it spits back null....

 

 

sample code:

(when u select the second row - indice 1 it 'should' report back the value... however console log ends up:

 

$selectedRow ID: 1
 dynamic rowID: 
 static rowID: Row 1: Col 2
>Exit code: 0    Time: 12.189
 
static rowID is line 63 where i hardcoded 1 instead of using the variable from _GUICtrlListView_GetSelectedIndices
AutoIt         
#include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> Example() Func Example()     Global $hImage, $hListView     ; Create GUI     GUICreate("ListView Add SubItem", 400, 350)     $selected = GUICtrlCreateButton("Selected", 276, 300, 73, 25)     $hListView = GUICtrlCreateListView("", 2, 2, 394, 268, -1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES))     GUISetState(@SW_SHOW)     ; Add columns     _GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)     _GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)     _GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100)     ; Add items       For $i = 0 To 50          ; ConsoleWrite("i: " & $i & @CRLF)           _GUICtrlListView_AddItem($hListView, "Row " & $i & ": Col 1", $i)           _GUICtrlListView_AddSubItem($hListView, $i, "Row " & $i & ": Col 2", 1, 1)           _GUICtrlListView_AddSubItem($hListView, $i, "Row " & $i & ": Col 3", 2, 2)       Next ; ConsoleWrite("i: " & $i & @CRLF)     ; Loop until the user exits. While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit         Case $selected            getSelected()         EndSwitch    sleep(10) ; take it easy on the CPU. WEnd  EndFunc   ;==>Example Func getSelected()    $selectedRow = _GUICtrlListView_GetSelectedIndices($hListView) ; return the selected row    ConsoleWrite("$selectedRow ID: " & $selectedRow & @CRLF)    $rowID = _GUICtrlListView_GetItemText($hListView, $selectedRow, 1)    ConsoleWrite(" dynamic rowID: " & $rowID & @CRLF)    $rowID = _GUICtrlListView_GetItemText($hListView, 1, 1)    ConsoleWrite(" static rowID: " & $rowID & @CRLF) EndFunc ;==> getSelected

_Excel_RangeRead help

$
0
0

how to read single active cell, like for example

;; i will click on B33 or I will move the selection from B40 to B33 using arrow keys then do my script $ClickedCell = "" HotKeySet("{F1}", "Read") Func Read() Local $sText = WinGetTitle("[CLASS:XLMAIN]") $iText = StringLeft($sText, 5) Local $sWorkbook = $iText & ".xlsx" $oWorkbook = _Excel_BookAttach($sWorkbook, "filename") Local $sResult = _Excel_RangeRead($oWorkbook, Default, $ClickedCell) MsgBox(0, "Excel", $sResult) EndFunc

how will i get the data from $ClickedCell ??? except for ctrl+v

Rename all folders in a directory

$
0
0

Greetings  :bye:

 

I've read a few threads here about bulk renaming of files, but I haven't quite found what I'm looking for.

 

I'm trying to rename all folders in a directory. Lets say my source directory is the following:

\\server\share$

 

Is it possible to list all folders in this directory and add something to each subfolder name? - For example: _renamed

 

 

View of source directory: \\server\share$\

Directory before bulk rename:

Folder1

Folder2

Folder3

 

Directory after bulk rename:

Folder1_renamed

Folder2_renamed

Folder3_renamed

 

 

 

Any help would be much appreciated  ^_^

Change user or start with different user

$
0
0

Hi,

 

I want to use Features in an AutoIt program that require admin Level. I can think of 2 possibilities:

1. Change the user while running an AutoIt program. Is that possible, how?

2. Start a new / second AutoIt program and that program should run with the account of a user of the admin Group. Possible? How to do that?

3. something I didn't think of!?

 

The Passwort of a user of the admin Group is known.

 

The whole context is like this: An application (not an AutoIt program, not run with admin account) should call an AutoIt program to do some things (like Reading EventLog, killing processes, deleting files) that require admin rights.

 

Thanks for anwers!

dolphins

Debugging (debug mode = y doesn't start)

$
0
0

Hello forum users!

 

I ran into a little problem, and can't seem to solve it by my own.

I have the following lines in my script:

 

#AutoIt3Wrapper_Run_Debug_Mode = Y #AutoIt3Wrapper_Run_Debug = On  

Yet when i run my script the console stays empty, I read the helpfile and the wiki, but couldn't find the solution.

 

I'm not sure, but I think I miss an include maybe? The annyoing thing is that i used this debug mode before, with great effectivnes, but now I can't make it to work.

 

Ps.: Bonus Question: Is there a step by step scriptrun mode in autoit? I recall reading it somewhere, but can't find it. It would be a very lovely addition to my basic debugging skills :)

Viewing all 12506 articles
Browse latest View live


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