Jump to content

langthang084

Active Members
  • Posts

    140
  • Joined

  • Last visited

Everything posted by langthang084

  1. I want to wait the website in 10s, if after 10s the website dont load complete then do some script. Here's my code but it dont run correct. Could anyone help me to solve this problem #include <ie.au3> $IE = _IECreate("google.com", 0, 1, 0) $wait = _IELoadWait($IE, 0, 10000) if $wait = @error Then ... EndIf $Read = _IEBodyReadText($IE)
  2. Here my code with IE, but why I dont use Filter with these link? and dont add $link[$i] to array? #include <IE.au3> #include <Array.au3> #include <File.au3> Local $oIE = _IECreate("http://www.youtube.com/results?search_query=ABCDE") Local $oLinks = _IELinkGetCollection($oIE) Local $iNumLinks = @extended $link = 0 $linkend = 0 Local $sTxt = $iNumLinks & " links found" & @CRLF & @CRLF For $oLink In $oLinks $sTxt &= $oLink.href & @CRLF Next $Finish = FileOpen("C:\temp.txt", $FO_APPEND + $FO_UTF8) FileWrite($Finish, $sTxt) _FileReadToArray("C:\temp.txt", $link) for $i = 0 to $link[0] if $link[$i] = "http://www.youtube.com/watch?v=" Then _ArrayAdd($linkend, $link[$i]) EndIf Next _ArrayDisplay($linkend, "")
  3. Thanks! But how to do this with Chrome?
  4. I want to search something on the internet (like Google, Youtube...). And I will get the list of result links. So how to declare each link in the variable?
  5. I use Stringisupper but it dont work with unicode character and space. Are there other ways to do this?
  6. Yeah! All because of the "Tooltip"
  7. I have 2 folders, Folder 1 contain 15000 files, Folder 2 contain 2000 files. I want to delete all the files in Folder 1 which has the same name with Folder 2. And here's my code #include <file.au3> $path = "D:\datadic\FOLDER2\" $path2 = "D:\datadic\FOLDER1\" $listLD = _FileListToArray($path, "*.doc", 1, False) $listFull = _FileListToArray($path2, "*.doc", 1, False) for $i = 1 to $listFull[0] for $f = 1 to $listLD[0] ToolTip("Full " & $i & " LD " & $f, 600, 100) if $listLD[$i] = $listFull[$f] Then FileDelete($path2 & $ListFull[$f]) ContinueLoop EndIf Next Next Exit But it tooks so long because of 15000 files in Folder 1 Is there an other way to do this? Thanks all!
  8. Thanks guinness for this code: AU3_Example.txt file: MsgBox(0, "It Works", "Hello World") AutoIt Script: _RunAU3("AU3_Example.txt") _RunAU3("AU3_Example.txt") _RunAU3("AU3_Example.txt") _RunAU3("AU3_Example.txt") _RunAU3("AU3_Example.txt") Func _RunAU3($sFilePath, $sWorkingDir = "", $iShowFlag = @SW_SHOW, $iOptFlag = 0) Return Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $sFilePath & '"', $sWorkingDir, $iShowFlag, $iOptFlag) EndFunc ;==>_RunAU3 But It runs 5 au3 script at the same time, but I want to run it step by step. What could I do? (I dont want to make 5 script in one, because after one finishes, I must change it code (like the folder and the file path) and run again, So I want to change it first to 5 new script, and run step by step)
  9. #include <Clipboard.au3> Opt("WinTitleMatchMode", 2) WinWaitActive("Word") send("^a") sleep(300) send("^c") $win = WinGetHandle("Word") _ClipBoard_Open($win) sleep(300) _ClipBoard_Empty() here's my code, but it dont work
  10. I use Clipput("") but It dont work. So, how to make Office Clipboard empty?
  11. Ex: My document has 20 words to replace. First, it replaces 12 words. After that, it replaces 8 words (so it needs 2 command lines). I only need to replace in body section. I use Microsoft Word 2003
  12. _Word_DocFindReplace($oDoc,"AA" ,"BB" , $WdReplaceAll, 0, True ) When my document have many word to replace, this command line above only replace a part of them, so I must repeat this _Word_DocFindReplace(). Is the another way to replace all in one command line?
  13. I have two text files: TEXT 1: " AAAAAA BBBBB CCCCC DDDDD ..........." TEXT 2: "BBBBB EEEEE DDDD ......." I want to check all the lines in each files, and export to two new text files: one include the duplicate line, and one include the remainder. How could I do this?
  14. here's my code: HotKeySet("^!1", "test") for $i = 1 to 10 Then if $i = 5 Then send("^!1") sleep(300) Else MsgBox(0, "", $i) EndIf Next Func test() ContinueLoop EndFunc But It has error:"ExitLoop/ContinueLoop" statements only valid from inside a For/Do/While loop.: How to use contineuloop in func? (I dont want to put Contineuloop in for ...to ) thanks!
  15. I've tested this but the result is "D%3A%5CDATA1%5CA+B+C.htm". I want the result is "D:/DATA1/A%20B%20C.htm"
  16. I dont know why it disappear. It's File.au3 and Chrome.au3 (Chrome UDF from our forum).
  17. #include <File.au3> #include <Chrome.au3> $l = "D:\DATA1\A B C.htm" $UnicodeBinary = StringToBinary ($l, 4) $UnicodeBinary2 = StringReplace($UnicodeBinary, '0x', '', 1) $UnicodeBinaryLength = StringLen($UnicodeBinary2) Local $EncodedString For $i = 1 To $UnicodeBinaryLength Step 2 $UnicodeBinaryChar = StringMid($UnicodeBinary2, $i, 2) If StringInStr("$-_.+!*'(),;\?:@=&abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", BinaryToString ('0x' & $UnicodeBinaryChar, 4)) Then $EncodedString &= BinaryToString ('0x' & $UnicodeBinaryChar) Else $EncodedString &= '%' & $UnicodeBinaryChar EndIf Next ;Return $EncodedString $URL = $EncodedString _ChromeStartup($URL) MsgBox(0, "", $URL, "") Chrome ver 33, Chrome UDF from our forum. In Windows XP, it run normanly but in Win 7, the link in Chrome is "file:///D:/DATA1/A%2520B%2520C.htm" (the "%" is converted to "%25") but the MsgBox is "D:/DATA1/A%20B%20C.htm", So in Chrome this htm dont load What should I do now? THanks all!
  18. Here's my code: Opt("WinTitleMatchMode", 2) For $i = 0 to 100 WinActive("SciTE-Lite") WinWaitActive("SciTE-Lite") sleep(150) if WinActive("AAA.au3") = @error Then ControlSend("SciTE-Lite", "", "[CLASS:Scintilla; INSTANCE:1]", "^o") sleep(150) WinWaitActive("Open File") ControlSetText("Open File", "","[CLASS:Edit; INSTANCE:1]", "D:\Auto_New\MM\AAA.au3") ControlSend("Open File", "","[CLASS:Edit; INSTANCE:1]","{enter}") sleep(150) endif WinWaitActive("AAA.au3") sleep(150) ControlSend("SciTE-Lite", "", "[CLASS:Scintilla; INSTANCE:1]","^g") WinWaitActive("Go To") ControlSend("Go To", "", "[CLASS:Edit; INSTANCE:1]", 22) sleep(150) ControlSend("Go To", "", "[CLASS:Edit; INSTANCE:1]","{enter}") WinWaitActive("SciTE-Lite") ControlSend("SciTE-Lite", "", "[CLASS:Scintilla; INSTANCE:1]","+{end}") sleep(150) ControlSend("SciTE-Lite", "", "[CLASS:Scintilla; INSTANCE:1]","{delete 2}") sleep(150) ControlSend("SciTE-Lite", "", "[CLASS:Scintilla; INSTANCE:1]","^s") sleep(150) ControlSend("SciTE-Lite", "", "[CLASS:Scintilla; INSTANCE:1]","!{f4}") sleep(150) Next exit But SOMETIME it dont run correctly. Ex: Dont active SciTE-Lite in the next loop, or with CTRL + O, only O is Pressed; DELETE twice times but its pressed three times. How do I solve it?
  19. Sorry, My internet was off until now. I dont want to delete all enter. I want to connect all the number lines to the alphabet line abovet it. Like this: "AAAAAAA 111 222 333 BBBB 444 555" ===> "AAAAAAA: 111,222,333 BBBB: 444,555" the total alphabet and number lines are random, and there're many paragraphs like this. So I want to stop the script at "5" (End of paragraph or end of word like you understand) to run again with the new paragraph
  20. Hj. Sorry. The app is microsoft word. The lines are seperated by {enter}. All i want is change the layout of this paragraph
  21. My paragraph like: "Aaasasssssssaaaaaa 2222222222222 33334444 Aaaaaaaaaa 12455666....." Total line is random but a line is only alphabet or number. So, i want to rearrange a number line be connected by the alphabet line. and finish when all line's done.
  22. Ah! I want to stop at the last character (include "space"), after check character above
  23. Thanks you! M23. But how to make script stop at the end of paragraph?
  24. i've a paragraph and I click random on it. So, how to recognize a character at the back of the control (in word) is alphabet or number?
  25. i want to use with "Find and Replace" in Word. send("aaaaaaaaaaaaaaaaaaaaaaaaaaa") sleep(1000) send("{tab}") sleep(300) send("bbbbbbbbbbbbbbbbbbbbbbbbb") sleep(1000) send("!a") sleep(300) then the result is "aaaaaaaaaaaaabbbb" and i dont know how to use ControlSetText with "find and replace" :|
×
×
  • Create New...