Jump to content

Sly01

Active Members
  • Posts

    37
  • Joined

  • Last visited

Everything posted by Sly01

  1. Unfortunately, it's not the script that opens that window... There is a constant process. that processes documents and open Word to render them in TIF files. So I don't think that would work That's why I really need a way to close that window pane...
  2. So I'm trying to get rid of that stupid Navigation bar on the side of word... It's not something needed but as I am getting better with AutoIT I would love to understand how I could do it. There is no ID in the Control.... And the number at the end of the class may change if it comes back later on... Would I have a way to run through each of them until I find the Navigation one and then click on the X?
  3. Ohhhh @Nine Génial!!!!! If there is an OCR way, maybe that could fix my issue, I will have to try and get the file when that error comes up again. Fortunately it's not that often
  4. @jchd I'm sorry this is not an option. Unfortunately this is an automated system, not a system that we actually manage files. So I wouldn't go through the whole process of fixing the file. If the file has a problem I want the error to go away, the Rendering does not happen, and customers are getting an error that it didn't work. This way they can fix the file, or contact us to check what's happening.
  5. The other problem with this one, is that the window Size may change due to the file name XD
  6. Hi Nine, I'm sorry I'm not 100% sure what you mean here... My application (AutoIT) runs constantly to check for possible error message on the screen and needs to deal with it when it finds one. But this error message is NOT detectable. As it has no Visible Text, not special title and the class is a general class. My AutoIT knowledge stops there - That's my only knowledge I have and that's the extent I tried - Find the window in any particular way, but I don't see a way, because as I attached I don't know how else I could find that error, because AutoIT cannot "see it"... Yeah... MAYBE not a bad idea... The only problem is if I have another error that has the same size, it could be "handled" wrongly, which is the reason why, the first time I tried with the CLASS (because it was the only thing I could think of) failed because I think the Print window uses the same CLASS and I ending up cancelling the print job from time to time (or something of the sort )
  7. No one has an idea?
  8. I have an error message from Microsoft word that says: We're sorry. We can't open Filename because we found a problem with its contents. The title is Microsoft Word but there is no text (you can see in the attached AuINFO information). Can anyone help me how to deal with this error? The other problem I have with this is that the Class is used for other errors to, so I cannot just used this class. Does anyone have an idea how to click on the "OK" when detected? We're Sorry.txt
  9. Hi Everyone Thanks for your help as usual!!!!! Always amazed!!! I found what the problem is... Because the files may have been in use once I create the Array... The files MAY be deleted by the time the Script get to the file. So when it goes through the FOR and gets to : $fileTime = FileGetTime($Path & "\" & $aFileList[$i],0,0) If the file has been treated and is now missing, it obviously cannot find the file so it cannot find the date. I've add a FileExists in the For before doing everything so something like: InfoLog("Starting Delete Temp File") Local $NowDate = _NowCalc() Local $aFileList = _FileListToArray($Path, $Pattern, 1) If Not @error Then If $aFileList[0] > 0 Then For $i = 1 to $aFileList[0] Local $iFileExists = FileExists($Path & "\" & $aFileList[$i]) If $iFileExists Then Local $fileTime = FileGetTime($Path & "\" & $aFileList[$i],0,0) Local $FileDate = $fileTime[0] & "/" & $fileTime[1] & "/" & $fileTime[2] & " " & $fileTime[3] & ":" & $fileTime[4] & ":" & $fileTime[5] If _DateDiff( 'n',$FileDate,$NowDate) > $MaxAge Then Local $delResult = FileDelete($Path & "\" & $aFileList[$i]) If $delResult = 1 Then FileDeleteLog("File " & $aFileList[$i] & " in folder " & $Path & " has been deleted.") EndIf EndIf EndIf Next EndIf Else FileDeleteLog("No files detected - Error Returned: " & @error) EndIf
  10. @ioa747 Thanks The $DelTempTimer I added it to the script above and it's in my normal script. My complete script has more than 1000 lines so I won't put the whole thing in here haha But the error really points to $fileTime = FileGetTime($Path & "\" & $aFileList[$i],0,0) Which I'm really wondering why XD...
  11. M23, Thanks for your reply, I'm not 100% sure I understand what you mean (I'm not a real Dev / Progammer so that might be a concept I don't understand) If I get what you're saying, is that when I delete a file, the array gets smaller? But I don't re-iterate the Array constantly. So the array stays the same until the end no? Why would the Array content changes if I don't recall the Array after every file delete - Sorry If I don't understand what you're trying to say, but I worked with Array before, and the Array should stay the same until the end, or not? The one thing I thought about, though, through your help, is that it COULD be possible that the file content changed WHILE I do my checks. So in the Array a certain file would be listed, but by the time it gets to the Deletion part that file does not exist anymore (as the automated process stills runs in the background) Should I add another check before process "$aFileList[i]" make sure that the file still exists?
  12. One thing might be worth mentioning the error happened so far when I call InfoLog("[DELTEMP]Starting Application Temp cleanup")             DelTemp("C:\Application\temp", "*", 2880) ; Delete the Application Temp folder after 2 days Or InfoLog("[DELTEMP]Starting Empty DelTemp")             DelTemp() ; Delete the *.tmp in @TempDir after 3 hours
  13. Good Day Everyone, So I've started seeing the "Error: Subscript used on non-accessible variable" - As prescribed I'ved used Au3Stripper to find which line causes the problem. Unfortunately those are automated computers, so I cannot run the executables within SciTE to really pinpoint the error... But still, every time I checked it leads me to 1 of my functions I created. The goal of the Function is to list a folder content - Check for the dates then delete anything that is older then X. Below is the transcript of it, I've left as many things that I'm using in there so you have an idea of the general function. When I run AU3Stripper it would give me an error around: $fileTime = FileGetTime($Path & "\" & $aFileList[$i],0,0) So I had to rewrite this portion of the script that was "working" before, because I realised it was not deleting folders. The function before was using FindFileFirstFile and FindFileNextFile. So I started using _FileListToArray with different pattern. The first thing I understand I had to do - So the Variable is not empty was to use a @error to make sure that the _FileListToArray was not empty. So anyone can have an idea as to where I made a mistake that gives an empty array? Dim $DelTempTimer = TimerInit() ; Variables for Folders Dim $MBKLogDir = "C:\MsgBoxKiller\logs" If Not FileExists ( $MBKLogDir ) Then DirCreate ( $MBKLogDir ) ; General Info Logs Func InfoLog( $Line = "" ) _FileWriteLog( $MBKLogDir & "\msgboxkiller-" & @YEAR & "-" & @MON & "-" & @MDAY & ".log", @ComputerName & " # [INFO] " & $Line) EndFunc ; Logging Function for File Deletion Func FileDeleteLog ( $Line = "" ) _FileWriteLog( $MBKLogDir & "\msgboxkiller-" & @YEAR & "-" & @MON & "-" & @MDAY & ".log", @ComputerName & " # [FILE DELETION] " & $Line ) EndFunc Func DelTemp($Path = @TempDir, $Pattern = "*.tmp", $MaxAge = 180) InfoLog("Starting Delete Temp File") $NowDate = _NowCalc() $aFileList = _FileListToArray($Path, $Pattern, 1) If Not @error Then If $aFileList[0] > 0 Then For $i = 1 to $aFileList[0] $fileTime = FileGetTime($Path & "\" & $aFileList[$i],0,0) $FileDate = $fileTime[0] & "/" & $fileTime[1] & "/" & $fileTime[2] & " " & $fileTime[3] & ":" & $fileTime[4] & ":" & $fileTime[5] If _DateDiff( 'n',$FileDate,$NowDate) > $MaxAge Then $delResult = FileDelete($Path & "\" & $aFileList[$i]) If $delResult = 1 Then FileDeleteLog("File " & $aFileList[$i] & " in folder " & $Path & " has been deleted.") EndIf EndIf Next EndIf Else FileDeleteLog("No files detected - Error Returned: " & @error) EndIf InfoLog("Starting Delete Temp Folder") $aDirList = _FileListToArray($Path, $Pattern, 2) If Not @error Then If $aDirList[0] > 0 Then For $i = 1 to $aDirList[0] $dirTime = FileGetTime($Path & "\" & $aDirList[$i],0,0) $dirDate = $dirTime[0] & "/" & $dirTime[1] & "/" & $dirTime[2] & " " & $dirTime[3] & ":" & $dirTime[4] & ":" & $dirTime[5] If _DateDiff( 'n',$dirDate,$NowDate) > $MaxAge Then $delResult = DirRemove($Path & "\" & $aDirList[$i],1) If $delResult = 1 Then FileDeleteLog("Folder " & $aDirList[$i] & " inside " & $Path & " has been deleted.") EndIf EndIf Next EndIf Else FileDeleteLog("No files detected - Error Returned: " & @error) EndIf EndFunc If TimerDiff ($DelTempTimer) >= 600000 Then InfoLog("[DELTEMP]Starting Empty DelTemp") DelTemp() ; Delete the *.tmp in @TempDir after 3 hours InfoLog("[DELTEMP]Starting MsgBoxKiller Logs cleanup") DelTemp($MBKLogDir, "*", 20160) ; Keep MsgBoxKiller Log file for 2 weeks InfoLog("[DELTEMP]Starting C:\Temp cleanup") DelTemp("C:\Temp", "*", 20160) ; Keep files in Temp folder for 2 Weeks for investigation in case of errors InfoLog("[DELTEMP]Starting Application Conversion Logs cleanup") DelTemp("C:\Application\Logs", "Convert2tiff*", 20160) ; Keeps File2Tiff logs for 2 weeks InfoLog("[DELTEMP]Starting Content.Word cleanup") DelTemp(@LocalAppDataDir & "\Microsoft\Windows\INetCache\Content.Word", "*") ; Delete Temp Folder after 3 hours InfoLog("[DELTEMP]Starting Content.MSO cleanup") DelTemp(@LocalAppDataDir & "\Microsoft\Windows\INetCache\Content.MSO", "*") ; Delete Temp Folder after 3 hours InfoLog("[DELTEMP]Starting Application Temp cleanup") DelTemp("C:\Application\temp", "*", 2880) ; Delete the Application Temp folder after 2 days $DelTempTimer = TimerInit() EndIf
  14. Solution was find by using au3stripper as per what Dan was mentioning above with Mergeonly options
  15. Thanks for your help, here is how I found how to do it. Opt("WinTitleMatchMode", 4) $WindowHandle = WinGetHandle("[TITLE:Microsoft Excel; CLASS:NUIDialog]","") WinActivate("$WindowHandle") Sleep(1000) Send("n") Excel was a bit more tricky, because in the case I have... Application Sending Print Job to Excel > Excel Opening for Printing > Send Print Job > At whatever point the file was modified and when Excel is trying to close after the print, detects the changes ask to save But the Save Dialog is not popping up automatically, you have to "Click" on excel wait for a few seconds and THENNNNN only the Save Dialog appears. So I had to add change it a little bit for Excel: Opt("WinTitleMatchMode", 2) WinActivate("Excel") Sleep(5000) Before doing my check for windows or errors, I made sure to Activate Excel with whatever windows there is wait 5 seconds to give it time to show, and then I let my script running
  16. I tried to WinActivate using the classes, but it doesn't seem to work WinActivate("[CLASS:NetUIHWND]") and WinActivate("[CLASS:NUIDialog]") and WinActivate("Microsoft Word", "[CLASS:NUIDialog]") Nothing seem to activate it. Other than that, I have no idea what I can try... Beyond my small knowledge What do you mean by Events? Sorry I never worked with those as of yet... But bear in mind that this is an automation computer, there is no real interaction with humans. This SAVE is actually a problem it should not happen. This is a Document that is being printed through Microsoft Word through command line, and probably the document is malformed, when the print is over and Microsoft word is trying to exit it detects it "fixed" something in it, then ask to save the changes.
  17. >>>> Window <<<< Title: Microsoft Word Class: NUIDialog Position: 657, 444 Size: 366, 122 Style: 0x94C80000 ExStyle: 0x00000101 Handle: 0x00000000001F044A >>>> Control <<<< Class: NetUIHWND Instance: 1 ClassnameNN: NetUIHWND1 Name: Advanced (Class): [CLASS:NetUIHWND; INSTANCE:1] ID: Text: Position: 0, 0 Size: 350, 83 ControlClick Coords: 159, 15 Style: 0x56000000 ExStyle: 0x00000000 Handle: 0x00000000000D045E >>>> Mouse <<<< Position: 824, 490 Cursor ID: 0 Color: 0xF0F0F0 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< >>>> Hidden Text <<<< Here you can see attached, that's the only thing I am able to pick
  18. Yes exactly what I thought ... Windows 2016 and Office 365 don't have the same details... It's really weird
  19. @Jos I'm currently facing a similar Situation. I've ran Au3Stripper the only thing it does is removing my comments and empty lines... I don't see the rest of the code.. So my code goes from 700 to 500 lines ... But I need 9390 am I missing something?
  20. It's an automated machine, I cannot run it within SciTE. But thanks for the Idea
  21. @Nine Misuse Au3Info... Seriously? How could you misuse it... Click and point hahaha ;o) What version of Office are you using? The save window give me no details at all, No Classe no nothing no text I've used it for all my other error messages I take care of, I wouldn't see what I am doing different there... Unless there is another trick the point and click that I've never used
  22. Hi Merci But how could you find the CLASS:#32770 When I use AutoIT Window Info I get NOTHING
  23. Still got the error but now it gives line 9390....... There is no way to find which line is that is there?
×
×
  • Create New...