Jump to content

YouriKamperman

Members
  • Posts

    4
  • Joined

  • Last visited

YouriKamperman's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. Works like a charm! Thanks a lot for the quick reply!
  2. I am working on a script that will turn all file names in a directory into an array, and then writes this Array to an Excel file. This in itself is working, but the RangeWrite function always puts the Array count in the first cell. How can i make sure this does not happen? I can of course just filter it out in Excel, but i am trying to keep all logic of filtering text in my script. This is what my script looks like: Local $Yesterday = _DateAdd('d', -1, _NowCalcDate()) Local $cDate = StringReplace($Yesterday, "/", "-") Local $aFileList = _FileListToArray(@WorkingDir & "/" & $cDate, "*") Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookNew($oExcel) _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $aFileList)
  3. Thanks! Works like a charm, and a much cleaner way of doing the same thing.
  4. I wrote a script in AutoIT that should take a printscreen, paste it in MS Paint and automatically save it with the current date and time. All of the main functionality is working, but the datetime seems to have some inconsistency problems in the formatting. I want the date formatted as DDMMYYYY HHMMSS but i get YYYY HHMMSS and sometimes YYY HHMMSS. I also have a problem where the save window is opened up again after simulating the Enter keypress. Any ideas about what can be the problem? Below you can find my code. Thanks in advance for the help. #include <Constants.au3> #include <Date.au3> #Include <WinAPI.au3> ; Script Function: ; Make a screenshot of the current screen ; ; Prompt the user to run the script. Local $iAnswer = MsgBox(BitOR($MB_OK, $MB_SYSTEMMODAL), "Screenshot maken", "Zorg dat je op de juiste pagina in TPC bent en druk dan op OK.") Send("{PRINTSCREEN}") Run("mspaint") WinWaitActive("Untitled - Paint") Send("^v") ChangeDateFormat() SaveFile() Func ChangeDateFormat() Global $sDate = _Now() Global $sOutput = StringRegExpReplace($sDate, "(?i)[^a-z0-9]", "") EndFunc Func SaveFile() Send("^s") Send($sOutput) sleep(500) Send("{ENTER}") EndFunc ; Finished!
×
×
  • Create New...