Leaderboard
Popular Content
Showing content with the highest reputation on 08/16/2016 in all areas
-
Hi, @jaberwacky! It looks like Andreik and TheDcoder have answered to your question. I've done no tests so far with _WinAPI_SetProcessAffinityMask, tho. ---------------------- Hi, JiBe! Actually, the AdlibRegister is not the true way it runs the "threads". Truly it really creates new processes and uses Adlib just to check for new messages (from the UDF _AuThread_SendMessage()) or closing signal. Also, it's really not the true multi threading. It's just an emulation. It's "forking" ---------------------- Hi, argumentum! Yes, this is the right name hehe. It came out of my mind at the time of the creation of this topic. I've added it to the topic title (I chose to keep "multi thread emulation" for helping users who are using the search engine, as some might not know what's forking). Thanks for poiting out --------------- Guys, I've started another project that, according to what my latest tests are poiting, might provide some kind of true multithreading for AutoIt without external processes. It's not fully working yet (so far it works just with basic tasks). This is an example: #include 'thread.au3' CreateThread("helloworld") Func helloworld($h) MsgBox(0, "", "Hello from the sub thread") EndFunc MsgBox(0, "", "Hello from the main thread") Exit If you want to help, here's the repo: https://github.com/jesobreira/thread.au32 points
-
multi threading
argumentum reacted to jchd for a topic
Exactly. And never forget that threads are evil. I mean here that multithreading "Hello World!" is one thing, but multithreading a non-trivial task is completely another one, especially with a high-level language which is explicitely not designed to cope with any drop of multithreading. Unless you gamble blindly about what AutoIt is doing under your feet when you invoke complex or high-level functions deeply interacting with the OS, you'd better stay away from MT in serious code, else you unduly multiply the risks of potential disaster.1 point -
Probably you can do somthing like this using the Object Class Name. Local $oFirstCheckBox = _IEGetObjByClass($oIE, "selectable") If IsObj($oFirstCheckBox) Then $oFirstCheckBox.checked = True EndIf Func _IEGetObjByClass(ByRef $o_object, $s_Class, $i_index = 0) If Not IsObj($o_object) Then __IEConsoleWriteError("Error", "_IEGetObjByClass", "$_IEStatus_InvalidDataType") SetError($_IEStatus_InvalidDataType, 1) Return 0 EndIf ; If Not __IEIsObjType($o_object, "browserdom") Then __IEConsoleWriteError("Error", "_IEGetObjByClass", "$_IEStatus_InvalidObjectType") SetError($_IEStatus_InvalidObjectType, 1) Return 0 EndIf ; Local $i_found = 0 ; $o_tags = _IETagNameAllGetCollection($o_object) For $o_tag In $o_tags If String($o_tag.className) = $s_Class Then If ($i_found = $i_index) Then SetError($_IEStatus_Success) Return $o_tag Else $i_found += 1 EndIf EndIf Next ; __IEConsoleWriteError("Warning", "_IEGetObjByClass", "$_IEStatus_NoMatch", $s_Class) SetError($_IEStatus_NoMatch, 2) Return 0 EndFunc ;==>_IEGetObjByClass That code just select the first one Checkbox. To handle all checkboxs of the list you can get a collection of the selectable object. of probably get the max selectable object index (Simple way could be getting doc html and use maybe stringreplace to count how many selectable object exist. then use _IEGetObjByClass with the correct object index to check/uncheck. I also think you can use _IETableGetCollection to get the table then check inside the table and get the checkbox objects. Saludos1 point
-
1 point
-
I think something like this should work. Local $oTriangola = _IEGetObjByName($oIE, "form_order") Local $cosa = _IEFormElementCheckBoxSelect($oTriangola, 0, "billing_address_in_waybill", 1, "byIndex") Saludos1 point
-
Mailing from Excel/variable storing
Revelation343 reacted to water for a topic
Outlook is just the frontend to a mail server like Exchange. I've never heard of a limit for Outlook. Maybe the mail server has a limit to prevent mail floods. Next idea would be to set the date in the Excel file. This would allow to restart the script without re-sending all mails by checking the date. Right now the created mails get displayed. If you want to send them automatically then better error checking would be needed. What do you plan as a next step?1 point -
Mailing from Excel/variable storing
Revelation343 reacted to water for a topic
Looks quite good Before using the script in production you could remove the ConsoleWrite statements. I inserted them for debugging reasons.1 point -
Ooohhhh , I will be following the changes on GitHub .1 point
-
invalid keyword
cherrylatte reacted to water for a topic
That's because Return can only be used from within a function. Do you mean "Exit" to end the script?1 point -
An example of the ' concatenation with Execute' as mentioned above. Local $String = "A1" & @CRLF & "B2" & @CRLF & "C3" & @CRLF & "D4" ;& @CRLF Local $NewString = '"1: " & "' & StringRegExpReplace($String, "(\R)", '$1" & _Counter() & ": ') & '"' ConsoleWrite($NewString & @LF) MsgBox(0, "Results", Execute($NewString)) Func _Counter() Local Static $iCount = 1 $iCount += 1 Return $iCount EndFunc ;==>_Counter1 point
-
ZIP.au3 UDF in pure AutoIt
HouseRockerZz reacted to lgvlgv for a topic
If $DLLChk <> 0 Then Return SetError($DLLChk, 0, 0);no dll Think this udf is based on an dll that dosent exist in win10 sorry, u could try http://www.autoitscript.com/forum/topic/85094-7zip/ this is also with a "dll" but it works greate.1 point -
He reported me? ... First, sorry if I have said anything wrong @JiBe , it is not my intention to hurt anyone! (The same is mentioned in my signature) I would welcome any counter-argument , but please do it here, not in the report box! .1 point
-
No AutoIt script needed. On booting, computer logs on to user account. Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] "AutoAdminLogon"="1" "DefaultUserName"="myUserid" "DefaultPassWord"="mypassword" A specified program is started. (The program is JMRI) Put a link to the JMRI program in the Autostart folder Periodic mouse moves are simulated to prevent the system from 'sleeping' or otherwise timing out. This to keep the JMRI program running and active. Change the Energie settings to always run. No sleep, no hibernate. No user interaction required to get to stable condition with JMRI running. Should be the fact.1 point
-
Maybe I can recommend a mental coach to help you deal with a standard Windows feature?1 point
-
Mailing from Excel/variable storing
Revelation343 reacted to water for a topic
#include <Excel.au3> #include "OutlookEX.au3" Global $oExcel = _Excel_Open() Global $oWorkbook = _Excel_BookOpen($oExcel, @ScriptDir & "\Test_Mail.xlsx", True) ; Open Excel workbook read-only Global $aData = _Excel_RangeRead($oWorkbook) _Excel_BookClose($oWorkbook, False) _Excel_Close($oExcel, False) $oOL = _OL_Open() ; Retrieve defined signatures Global $aSignatures = _OL_MailSignatureGet() ; Deactivate signature for new emails _OL_MailSignatureSet("", Default) ; Create, Modify and send mails For $i = 0 To UBound($aData, 1) - 1 $oItem = _OL_ItemCreate($oOL, $olMailItem, "", @ScriptDir & "\" & $aData[$i][2] & ".msg", "Subject=Test") ConsoleWrite("IC: " & @error & "-" & @extended & @CRLF) $aBody = _OL_ItemGet($oOL, $oItem, Default, "HTMLBody") ConsoleWrite("IG: " & @error & "-" & @extended & @CRLF) $sBody = StringReplace($aBody[1][1], "%Firstname%", $aData[$i][0]) _OL_ItemModify($oOL, $oItem, Default, "HTMLBody=" & $sBody) ConsoleWrite("IM: " & @error & "-" & @extended & @CRLF) _OL_ItemRecipientAdd($oOL, $oItem, Default, $olTo, $aData[$i][1]) ConsoleWrite("RA: " & @error & "-" & @extended & @CRLF) $oItem.Display() Next ; Set signature for new emails to previous value For $i = 1 To $aSignatures[0][0] If $aSignatures[$i][1] = True Then _OL_MailSignatureSet($aSignatures[$i][0], Default) ExitLoop EndIf Next _OL_Close($oOL) First (quick & dirty) example. Reads all records from Test_mail.xlsx with the structure as defined by you. Depending on the value in column C (MidWest, MidAtlantic) an email is created based on template MidWest.msg or MidAtlantic.msg. Placeholder "%Firstname%" is replaced with the recipients name. Then the mail is being displayed (parameter SentOnBehalf has not been set yet). What you need to do: Place above script in a directory Create MidWest.Msg and MidAtlantic.msg in the same directory Create Test_mail.xlsx in the same directory Example MidAtlantic.msg:1 point