-
Posts
7,103 -
Joined
-
Days Won
88
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by TheDcoder
-
-
Try this and spot the difference #include <IE.au3> Global $DocTranslator = "https://www.onlinedoctranslator.com/translationform" $oIE = _IECreate() _IENavigate($oIE, $DocTranslator) _IELoadWait($oIE, $DocTranslator) $Translation = _IEFormGetObjByName($oIE, "translation-form") $TranslationFrom = _IEFormElementGetObjByName($Translation, "from") _IEFormElementOptionSelect($TranslationFrom, "English", 1, "byText") $TranslationTo = _IEFormElementGetObjByName($Translation, "to") _IEFormElementOptionSelect($TranslationTo, "Dutch", 1, "byText")
-
When I make websites for my project, I generally ignore the whole "SEO" part... there would be no need to give it special attention when you are using a good and responsive website framework. In my view, we shouldn't make websites more "search engine friendly". The search engines are supposed to improve... that is what most search engines do anyway, they encourage you to focus on the content, not the SEO. In a nutshell: If you have original content, ignore SEO. If you really want your website to be on the 1st page then fill your website with long and "SEO" friendly text which annoys users
-
Trying to loop through every row in a Excel sheet
TheDcoder replied to TheDcoder's topic in AutoIt General Help and Support
@Subz It works! I have no idea how... but it does work . Although I have noticed that it can take a while (around 5 seconds for me) for the code to filter all blank rows -
Trying to loop through every row in a Excel sheet
TheDcoder replied to TheDcoder's topic in AutoIt General Help and Support
Yep, I can understand . P.S Congratulations on the 200th post -
Trying to loop through every row in a Excel sheet
TheDcoder replied to TheDcoder's topic in AutoIt General Help and Support
@water That is what I had in mind . I am urged to create another function which can remove all blank elements with the most efficient way to do it... but if I do that, I will be pushing my personal projects again... they have crossed the deadline a long time ago -
Trying to loop through every row in a Excel sheet
TheDcoder replied to TheDcoder's topic in AutoIt General Help and Support
@anthonyjr2 Your statement only makes it look smarter to be honest . There are several flaws... not to mention the obvious unnecessary rewriting of elements.... or that is what I thought until now. It actually moves all non-empty elements up, shifts all gaps to the bottom and then truncates the array. I have to admit, it's clever... but not very effective! Still does the job though, so I guess we can use it when feeling lazy . -
Trying to loop through every row in a Excel sheet
TheDcoder replied to TheDcoder's topic in AutoIt General Help and Support
I can only see one array and that is $arr No, what it's doing is using $idx to count all "non-blank" elements and and resizing/trimming the array using ReDim -
Trying to loop through every row in a Excel sheet
TheDcoder replied to TheDcoder's topic in AutoIt General Help and Support
@anthonyjr2 That's a strange way to remove blanks from an (1D) array... I wonder why it rewrites a row with the same contents? ($arr[$idx] = $arr[$i]) -
(solved) Help Big_Daddy's Spell Check
TheDcoder replied to MattHiggs's topic in AutoIt General Help and Support
@Subz Ah! My bad . I thought that @big_daddy's code used a spelling engine... -
Here is something that I created while _IELoadWait wasn't working with the job in hand. Some explanation first, I was working on a website automation project, I decided to use the IE UDF naturally. The website that I am trying to automate uses Javascript to log me in (no page refresh, no submitting form to new page etc.) so _IELoadWait do any good for me . Thanks to @TheSaint's excellent idea of checking for a piece of text that only appears after logging in (usually the username or the logout text). I present you _IEWaitForTagText! ; #FUNCTION# ==================================================================================================================== ; Name ..........: _IEWaitForTagText ; Description ...: Waits for a HTML tag to appear with the specified text ; Syntax ........: _IEWaitForTagText($oObject, $sTagName, $sTagText[, $iTimeout = 0[, $bNoError = True]]) ; Parameters ....: $oObject - Object related to IE (Any Window, Frame, IFrame or any DOM object). ; $sTagName - Name of the HTML tag (p, img, tr, etc). ; $sTagText - The (inner) text of the tag to wait for. ; $iTimeout - [optional] Timeout for the wait in milliseconds. Default is 0 (No timeout). ; $bNoError - [optional] Temporarily disable IE errors messages in the console. Default is True. ; Return values .: Success: The DOM element's object ; Failure: False and @error is set to 1 ; Author ........: Damon Harris (TheDcoder) ; Remarks .......: 1. Failure is impossible if $iTimeout is set to 0 ; 2. This is how $bNoError works: ; * If $bNoError is True, then _IEErrorNotify(False) is called and _IEErrorNotify(True) is called after the wait. ; * If $bNoError is True and _IEErrorNotify() is False, nothing will be changed. ; * If $bNoError is False, nothing will be changed. ; Related .......: _IELoadWait ; Link ..........: https://git.io/vHxOT ; Example .......: _IEWaitForTagText($oIE, "p", "logout") ; =============================================================================================================================== Func _IEWaitForTagText($oObject, $sTagName, $sTagText, $iTimeout = 0, $bNoError = True) Local $oTags, $hTimer, $sText, $bTurnOnNotify = False If Not $iTimeout = 0 Then $hTimer = TimerInit() If $bNoError And _IEErrorNotify() Then _IEErrorNotify(False) $bTurnOnNotify = True EndIf Do $oTags = _IETagNameGetCollection($oObject, $sTagName) For $oTag In $oTags $sText = _IEPropertyGet($oTag, "innertext") If @error Then ContinueLoop If ($sText = $sTagText) Then If $bTurnOnNotify Then _IEErrorNotify(True) Return $oTag EndIf Sleep(10) Next Until ($iTimeout = 0) ? False : (TimerDiff($hTimer) >= $iTimeout) If $bTurnOnNotify Then _IEErrorNotify(True) Return SetError(1, 0, False) EndFunc I only did some basic testing, I would appreciate if someone could code a simple HTML page with Javascript which can create a new element after 3 secs and test this function in that page to see if it works. That would make a great example! Enjoy, TD
-
(solved) Help Big_Daddy's Spell Check
TheDcoder replied to MattHiggs's topic in AutoIt General Help and Support
@Subz But that requires M$ Word to be installed on the computer! -
Trying to loop through every row in a Excel sheet
TheDcoder replied to TheDcoder's topic in AutoIt General Help and Support
I see... Okay, thanks for the help -
Trying to loop through every row in a Excel sheet
TheDcoder replied to TheDcoder's topic in AutoIt General Help and Support
Wow! It was so easy! Also, if possible, is there way to exclude blank rows in the _Excel_RangeRead function? -
Hello I am relatively new to the world of Microsoft Office and the Excel UDF. I am trying to loop through every row in a spreadsheet and get the text/values from each column in the given row... so far I have looked into the Help file for the Excel UDF and the wiki page for Excel UDF but I have no idea about how this is done ... This is all I have in my script: Global $oExcel = _Excel_Open(False, False, False, False, True) Global Const $sSpreadsheet = @ScriptDir & '\data.xlsx' Global $oSpreadsheet = _Excel_BookOpen($oExcel, $sSpreadsheet, True, False) ; ... I am placing my bet on the _Excel_Range functions... especially _Excel_RangeRead. I don't know how $vRange works so I would be glad if someone can point me in the right direction . What I would ideally like is to get all of the contents of the spreadsheet (it's just a normal text one) in a 2D array. Thanks in Advance!
-
Your welcome
-
Complete stranger needs help with AUTOIT script
TheDcoder replied to Islarama's topic in AutoIt General Help and Support
Do comment lines count? I can write really good and long comments -
-
EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD
TheDcoder replied to mLipok's topic in AutoIt Example Scripts
I think this is a much easier and better way to capture ConsoleWrite output from a compiled GUI AutoIt Script #include <Process.au3> $sExe = @ScriptDir & '\GUI Script.exe' $sLogFile = @ScriptDir & '\output.txt' $sCommand = @ComSpec & ' /c "' & $sExe & '" > "' & $sLogFile & '"' _RunDos($sCommand) -
Complete stranger needs help with AUTOIT script
TheDcoder replied to Islarama's topic in AutoIt General Help and Support
It is fairly easy to do it using AutoIt. I recommend that you try out AutoIt yourself, the wiki has some good resources: https://www.autoitscript.com/wiki/Tutorials Or if you are feeling lazy, you can hire a freelancer... like me (LOL, advertising) . -
How to send a space key to an active popup window.
TheDcoder replied to AssWipe's topic in AutoIt General Help and Support
You might consider learning the basics, they are very easy. There are several tutorials mentioned in the wiki: https://www.autoitscript.com/wiki/Tutorials I personally recommend Morthawt's Tutorials, that is what I followed to learn the basics of AutoIt and Programming