Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/06/2021 in all areas

  1. New version - 17 Jun 23 ======================= Added: Added 24hr unpadded H mask. New UDF in zip below. Changelog: Changelog.txt Here is my version of a UDF to transform date/time formats. It is entirely self-contained and although it defaults to English for the month/day names, you can set any other language very simply, even having different ones for the input and output. You need to provide a date/time string, a mask to tell the UDF what is in the string, and a second mask to format the output - the masks use the standard "yMdhmsT" characters. This is an example script showing some of the features: #include <Constants.au3> ; Only required for MsgBox constants #include "DTC.au3" Global $sIn_Date, $sOut_Date ; Basic format $sIn_Date = "13/08/02 18:30:15" $sOut_Date = _Date_Time_Convert($sIn_Date, "yy/MM/dd HH:mm:ss", "dddd, d MMMM yyyy at h:mm TT") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Note how day name is corrected $sIn_Date = "2013082 Sun 12:15:45 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "yyyyMMd ddd hh:mm:ss TT", "dddd, dd MMM yy") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Note use of $i19_20 parameter to change century $sIn_Date = "13/08/02 18:30:15" $sOut_Date = _Date_Time_Convert($sIn_Date, "yy/MM/dd HH:mm:ss", "dddd, d MMMM yyyy at h:mm TT", 10) MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) $sIn_Date = "18:30:15 13/08/02" $sOut_Date = _Date_Time_Convert($sIn_Date, "HH:mm:ss yy/MM/dd", "h:mm TT on ddd d MMM yyyy") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Just to show it works both ways $sIn_Date = "Friday, 2 August 2013 at 6:30 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "dddd, d MMMM yyyy at h:mm TT", "dd/MM/yy HH:mm") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) $sIn_Date = $sOut_Date $sOut_Date = _Date_Time_Convert($sIn_Date, "dd/MM/yy HH:mm", "dddd, d MMMM yyyy at h:mm TT") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Note false returns for non-specified elements $sIn_Date = "6:15 P" $sOut_Date = _Date_Time_Convert($sIn_Date, "h:m T", "yy/MM/dd HH:mm:ss") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Note use of "x" in place of actual spacing/punctuation $sIn_Date = "Sun 12:15:45 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "dddxhhxmmxssxTT", "dddd HH:mm") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Output month/day strings changed to French _Date_Time_Convert_Set("smo", "jan,fév,mar,avr,mai,juin,juil,août,sept,oct,nov,déc") _Date_Time_Convert_Set("ldo", "dimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi") _Date_Time_Convert_Set("SDO", 3) ; Each short name is first 3 chars of equivalent long name ; Note as only the short day names are required, they could have been set directly: ; _Date_Time_Convert_Set("sdo", "dim,lun,mar,mer,jeu,ven,sam") $sIn_Date = "20130716 Sun 12:15:45 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "yyyyMMd ddd hh:mm:ss TT", "ddd, d MMM yy") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; Output month/day strings changed to German _Date_Time_Convert_Set("smo", "Jan.,Feb.,März,Apr.,Mai,Juni,Juli,Aug.,Sept.,Okt.,Nov.,Dez.") _Date_Time_Convert_Set("ldo", "Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag") $sIn_Date = "20130716 Sun 12:15:45 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "yyyyMMd ddd hh:mm:ss TT", "dddd, d MMM yy") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) ; All strings reconverted to default English _Date_Time_Convert_Set() ; As shown here $sIn_Date = "20130716 Sun 12:15:45 PM" $sOut_Date = _Date_Time_Convert($sIn_Date, "yyyyMMd ddd hh:mm:ss TT", "ddd, d MMM yy") MsgBox($MB_SYSTEMMODAL, "DTC Conversion", $sIn_Date & @CRLF & $sOut_Date) And here is the UDF and example in zip format: DTC.zip As always, happy for any comments. M23
    2 points
  2. Note that the SelectionItemPattern is supported by the ComboBox control. The SelectionItemPattern is the correct way to handle selections. It's demonstrated in Example 11 of this post. As the ComboBox supports the SelectionItemPattern, there is a good chance that the list items are also supported. Then check the properties of the listitems.
    2 points
  3. Good afternoon everyone Third day into learning UIAutomation and I am struggling a bit to read the value of a Text control which is contained by a ListItem control. I am trying to learn UIAutomation following @LarsJ's UIAutomation tutorial, so I'd be very happy to get some advices without mixing this approach with the @junkew's one. Below, there are the ListItem and the Text control inspected with UIASpy. ListItem control: Text control: This is the code I'm using to read the various Text controls: This is the output from the SciTE console: As you can see, I posted some questions in the code itself because I tried different methods to do such task. I already tried with _GUICtrlListView_GetItemText* and ControlListView() functions once "arrived" to the ListView control, but none of them worked. Could you please direct me to the right approach to help me achieve this? Thank you in advance. Cheers
    1 point
  4. furthermore, by using _IEcreate in a loop you could end up with a screen full of browsers....
    1 point
  5. Don't worry... we ( MODs) are following topics and will act when needed. You can obviously also report the thread, but then please only when it is confirmed going against the rules as till now there is no evidence, hence you didn't see any action yet after your first report. So having said all of this: halve of the posts in this thread are now off-topic, so please don't post unless it is on-topic and let us do our work.
    1 point
  6. Good to see that someone is at least trying. When you cannot see the text value in UIASpy, I don't think you can create code to read the value yourself. This is probably because the control doesn't have adequate UI Automation support. And since your own experiments with classic code do not work either, it seems that the control completely lacks automation code. You can try with MSAA code in Inspect.exe. Switch to MSAA mode through the dropdown control in the upper left corner. If that does not work either, OCR techniques are probably the only solution.
    1 point
  7. No, trust me, you don't I think I learned just about everything I know from RegEx101.com. It's also amazingly helpful to test RegEx instead of trying it in a script repeatedly.
    1 point
  8. Sorry @dranzer006. I am more familiar with UIASpy tool. Could you please download it and post the UI Tree? Otherwise, I am not of much help here (sorry again!)
    1 point
  9. You may use FileGetVersion instead ?
    1 point
  10. No need to apologize, I just wanted you to know This seems to be the most popular AutoIt encryption method, however, I understand little of encryption and the difference between the use cases being discussed here and in the following thread. It sounds like it would be just as safe to hide keys using CodeCrypter and I'm certainly not taking the time to pick apart an obfuscated script
    1 point
  11. 1. From everything I can see, it looks like the RegEx isn't dependent on capital letters. Using the global flag (?i) makes RegEx not be case-sensitive. You can add this to the (?s) flag at the beginning like (?si). Alternately, capture lowercase letters as well as uppercase -- from [A-Z] to [a-zA-Z] 2. You mean sometimes there isn't a comma? You can make something in RegEx optional by using a question mark. 3. Do you ever have zip code extensions? (a 4 digit code after the zip code) You won't capture them currently. 1: (?si)([^\d]+)([^.]+\.)\h*(.*?)([A-Z]{2}),\h*(\d+) Or... (?s)([^\d]+)([^.]+\.)\h*(.*?)([a-zA-Z]{2}),\h*(\d+) 2: (?si)([^\d]+)([^.]+\.)\h*(.*?)([A-Z]{2}),?\h*(\d+) 3: (?si)([^\d]+)([^.]+\.)\h*(.*?)([A-Z]{2}),?\h*(\d+(?:-\d+)?)
    1 point
  12. I typically use an Edit control, with $ES_READONLY. I then do something like this: _GUICtrlEdit_AppendText($editProgress, @CRLF) _GUICtrlEdit_AppendText($editProgress, @TAB & @TAB & "===============Search Complete===============")
    1 point
×
×
  • Create New...