Leaderboard
Popular Content
Showing content with the highest reputation on 08/08/2017 in all areas
-
Version 1.6.3.0
17,292 downloads
Extensive library to control and manipulate Microsoft Active Directory. Threads: Development - General Help & Support - Example Scripts - Wiki Previous downloads: 30467 Known Bugs: (last changed: 2020-10-05) None Things to come: (last changed: 2020-07-21) None BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort1 point -
how to get the pressed menu item with out variable
nacerbaaziz reacted to InnI for a topic
If you don't know how wm_command works then use native message loop #RequireAdmin #include <GUIConstantsEx.au3> #include <file.au3> Local $hGUI, $menu, $file, $item[3] $hGUI = GUICreate("menu item") $menu = GUICtrlCreateMenu("Favourites") GUISetState() $file = @ScriptDir & "\file.txt" ;Writing file FileWrite($file, @WindowsDir & "\notepad.exe" & @CRLF) FileWrite($file, @WindowsDir & "\explorer.exe" & @CRLF) FileWrite($file, @WindowsDir & "\regedit.exe") ; add item to menu For $i = 1 To _FileCountLines($file) $item[$i - 1] = GUICtrlCreateMenuItem(FileReadLine($file, $i), $menu) Next FileDelete($file) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_event_close Exit Case $item[0] To $item[2] Run(GUICtrlRead($msg, 1)) EndSwitch WEnd1 point -
how to get the pressed menu item with out variable
nacerbaaziz reacted to InnI for a topic
#RequireAdmin #include <GuiMenu.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <file.au3> Local $hGUI, $menu, $file $hGUI = GUICreate("menu item") $menu = GUICtrlCreateMenu("Favourites") GUISetState() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") $file = @ScriptDir & "\file.txt" ;Writing file FileWrite($file, @WindowsDir & "\notepad.exe" & @CRLF) FileWrite($file, @WindowsDir & "\explorer.exe" & @CRLF) FileWrite($file, @WindowsDir & "\regedit.exe") ; add item to menu For $i = 1 To _FileCountLines($file) GUICtrlCreateMenuItem(FileReadLine($file, $i), $menu) Next FileDelete($file) While 1 Switch GUIGetMsg() Case $GUI_event_close Exit EndSwitch WEnd Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $item = _GUICtrlMenu_GetItemSubMenu(_GUICtrlMenu_GetMenu($hGUI), 0) Run(_GUICtrlMenu_GetItemText($item, _GUICtrlMenu_MenuItemFromPoint($hGUI, $item))) Return $GUI_RUNDEFMSG EndFunc1 point -
How can I make autoit copy and paste only numbers.
HanselGarvey reacted to iamtheky for a topic
If you want the literal, only numbers, maybe this: $string = "123-555-2838 mom" msgbox(0, '' , stringregexpreplace($string , "[^\d]" , ""))1 point -
StringFormat() is already integrated, it has not changed in 11 years, and the code in post #2 still works1 point
-
How can I make autoit copy and paste only numbers.
HanselGarvey reacted to TheSaint for a topic
Gawd. What a dumb moment .... and I use that function all the time ... Doh! And I generally always tack a '1' on the end, whether I need it or not. $string = StringSplit("123-555-2838 mom", " ", 1) Anyway, i like to give newbies a challenge. P.S. All my wrestling with SQL functions yesterday, for the first time, must have dulled my normal keen edge (at least I ended up with a nice INItoSQL converter in the end). That and playing around with my new RAM Disk program development.1 point -
How can I make autoit copy and paste only numbers.
HanselGarvey reacted to Simpel for a topic
Hi. Some german telephon numbers are written like: +49(0)40/1234 345-765 with or without spaces. I did not find out how to deal with the spaces ("\h" works not for me) so I decided to kill all spaces. $s = "some text+49(0)40/1234 345-765other text" $s = StringReplace($s, " ", "") Msgbox(0,"regex", StringRegExpReplace($s, '.*?([\d-/\+\(\)]+).*', "$1") ) Regards, Conrad1 point -
If StringRegExp(@OSVersion, '(?i)Win_(10|7|8)') Then ...1 point
-
To avoid Excel I suggest to read the CSV file as a text file into an array, manually format the numbers using Stringformat and then re-create the CSV file.1 point
-
How can I make autoit copy and paste only numbers.
HanselGarvey reacted to mikell for a topic
HanselGarvey, TheSaint is getting old. Please forgive him. Of course the correct instruction is $string = StringSplit("123-555-2838 mom", " ") BTW another way could be a regular expression $s = "some text_123-555-2838other text" ; get the part which contains only digits and/or hyphens Msgbox(0,"regex", StringRegExpReplace($s, '.*?([\d-]+).*', "$1") )1 point -
How can I make autoit copy and paste only numbers.
HanselGarvey reacted to TheSaint for a topic
If your number only ever has a space between number and text (name), then you could do a simple StringSplit on that space. $string = StringSplit("123-555-2838 mom") $number = $string[1] That will always return the first (or only) portion of the array regardless.1 point -
Pause Code
n3wbie reacted to JLogan3o13 for a topic
@LOWLIFE as this is against Facebook's TOS, not something we're going to discuss.1 point -
Webdriver UDF(based On External Exe)
PoojaKrishna reacted to n3wbie for a topic
Updated it to work with mozilla ff and chrome and most probably with all other drivers Example Script Updated in first post would like you to test same. Extremely sorry for delay please update me for other issue1 point -
Windows Installer - WinWait / WinClose
Elena reacted to mihaijulien for a topic
Hello, I'm trying to automate the installer process of an application. I currently have this following code: Start() Func Start() ShellExecuteWait(@ScriptDir & "\installer.msi") Local $hWnd = WinWait("[CLASS:MsiDialogCloseClass]",5) ;WinClose($hWnd) ControlClick("Installer Information", "","[CLASS:Button; INSTANCE:1]") ;Send("{ENTER}") EndFunc This function should only start the installer and press an Ok button of a popup window (or just close it). I tried with ControlClick() , Send() and WinClose() functions but the script only starts the installer. Can't figure out why it doesn't press that button/close the window.1 point -
1.) Yes 2.) You more likely wish to save the contents of these DllStructs verbatin, i.e. as binary. Doing otherwise would be a pain in the keyboard. 3.) You have all the possibilities offered by your OS for managing file permissions. AutoIt doesn't have much say at this level. 4.) You don't need more. Let's say you go by my version of 2.). All you have to do is, for every DllStruct of your, define own a container DllStruct having the same byte length and content, then write that to a file open in binary mode. Do the reverse for reads, left as an exercise. Local $s1 = DllStructCreate("align 1;byte;short;byte;real;align 2;byte[3];align 1; byte[7]") ; populate it ;then save it using this: Local $bs1 = DllStructCreate("byte[" & DllStructGetSize($s1) & "]", DllStructGetPtr($s1)) ; now $bs1 is a "flat" binary piece located at the same address as $s1 Local $h = FileOpen("MyStruct.bin", $FO_OVERWRITE + $FO_BINARY) FileWrite($h, DllStructGetData($bs1)) ; ...1 point