lafafmentvotre Posted January 23, 2018 Posted January 23, 2018 Hello I found this script. How can I concatenate values (email address) in a variable and put it in a GUICtrlCreateInput? $string = 'blablablabla <email1@domain.com>; blablablabla <email2@domain.com>; blablablabla <email3@domain.com>; blablablabla <email4@domain.com>; blablablabla <email5@domain.com>' $Array = _SRE_Between($string, '<', '>', 1) If IsArray($Array) Then For $i = 0 To UBound($Array) - 1 MsgBox(64, 'Info:', $Array[$i]) Next EndIf Func _SRE_Between($s_String, $s_Start, $s_End, $i_ReturnArray = 0); $i_ReturnArray returns an array of all found if it = 1, otherwise default returns first found $a_Array = StringRegExp($s_String, '(?:' & $s_Start & ')(.*?)(?:' & $s_End & ')', 3) If Not @error And Not $i_ReturnArray And IsArray($a_Array) Then Return $a_Array[0] If IsArray($a_Array) Then Return $a_Array EndFunc Thanks for help
careca Posted January 23, 2018 Posted January 23, 2018 Down for Stringsplit? $string = 'blablablabla <email1@domain.com>; blablablabla <email2@domain.com>; blablablabla <email3@domain.com>; blablablabla <email4@domain.com>; blablablabla <email5@domain.com>' $Split1 = StringSplit($string, ';') for $1 = 1 To $Split1[0] $Split2 = StringSplit($Split1[$1], '<') For $2 = 1 To $Split2[0] If $2 = $Split2[0] Then ConsoleWrite(StringTrimRight($Split2[$2], 1)&@CRLF) EndIf Next Next Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
lafafmentvotre Posted January 23, 2018 Author Posted January 23, 2018 Hello Careca Thank you. Is there a possibility to put value from ConsoleWrite to a GUICtrlCreateInput ? Thanks
careca Posted January 23, 2018 Posted January 23, 2018 Of course, simply take that part out and use GUICtrlSetData Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
lafafmentvotre Posted January 23, 2018 Author Posted January 23, 2018 Thanks, I tried to do this in my script. It works with consolewrite but doesn't work with Guictrlsetdata expandcollapse popup#region AUTOIT VARIABLES #include <GuiConstants.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #endregion #region SCRIPT VARIABLES Global $outlook_input, $string,$Split1,$Split2,$Split3 #endregion #region GUI $GuiManager = GuiCreate("Logon Default User", 700, 420, -1, -1,$WS_POPUPWINDOW) #region FILE MENU $filemenu=GUICtrlCreateMenu('File') $convert_item=GUICtrlCreateMenuItem('Convert',$filemenu) $copy_item=GUICtrlCreateMenuitem('Copy',$filemenu) $exit_item=GUICtrlCreateMenuitem('Exit',$filemenu) #endregion #region LIST FROM OUTLOOK GUICtrlCreateGroup('', 5, 12, 690, 150) GUICtrlCreateLabel('LIST FROM OUTLOOK',10,25,680,20,$SS_CENTER) GUICtrlSetFont(-1, -1, 800, 0, "",1) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel('Please paste your recipients from Outlook in field below',10,45,680,20,$SS_CENTER) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) $outlook_input=GUICtrlCreateInput("",20, 67, 660,80) #endregion #region LIST FOR EASYSHARE GUICtrlCreateGroup('', 5, 175, 690, 150) GUICtrlCreateLabel('LIST FOR EASYSHARE',10,185,680,20,$SS_CENTER) GUICtrlSetFont(-1, -1, 800, 0, "",1) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel('Please copy recipients below or click on button Copy',10,205,680,20,$SS_CENTER) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) $easyshare_input=GUICtrlCreateInput("",20, 227, 660,80) #endregion #region BUTTONS $convertbutton=GuiCtrlCreateButton('Convert', 240, 360, 70, 20, $BS_DEFPUSHBUTTON) $copybutton=GuiCtrlCreateButton('Copy', 315, 360, 70, 20) $exitbutton=GuiCtrlCreateButton('Exit', 390, 360, 70, 20) #endregion #region BACKGROUND #endregion #endregion #region SCRIPT GuiSetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Or $msg = $exitbutton or $msg=$exit_item Then DirRemove(@TempDir&'\Logon_User_Lancel',1) ExitLoop EndIf If $msg = $convertbutton or $msg=$convert_item Then convert() EndIf WEnd #endregion #region FUNCTIONS Func convert() $string=GUICtrlRead($outlook_input) $Split1 = StringSplit($string, ';') for $1 = 1 To $Split1[0] $Split2 = StringSplit($Split1[$1], '<') For $2 = 1 To $Split2[0] If $2 = $Split2[0] Then ;~ ConsoleWrite(StringTrimRight($Split2[$2], 1)&';') $Split3=StringTrimRight($Split2[$2], 1)&';' GUICtrlSetData($easyshare_input,$Split3,"") EndIf Next Next EndFunc #endregion Need your help again Thanks
careca Posted January 23, 2018 Posted January 23, 2018 GUICtrlSetData($easyshare_input,GUICtrlRead($easyshare_input)&$Split3) Because if not, you write the last value on top of the previous one Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
lafafmentvotre Posted January 24, 2018 Author Posted January 24, 2018 Hi works fine now. Many thanks for help
careca Posted January 24, 2018 Posted January 24, 2018 Did you understand why it wasn't working before? Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
ViciousXUSMC Posted January 24, 2018 Posted January 24, 2018 Might be faster? also just seems easier to use since its shorter. $string = 'blablablabla <email1@domain.com>; blablablabla <email2@domain.com>; blablablabla <email3@domain.com>; blablablabla <email4@domain.com>; blablablabla <email5@domain.com>' $aEmail = StringRegExp($string, "\<([^>]*)\>", 3) For $i = 1 To UBound($aEmail) -1 ConsoleWrite($aEmail[$i] & @CRLF) Next
iamtheky Posted January 24, 2018 Posted January 24, 2018 shorter... #include<array.au3> $string = 'blablablabla <email1@domain.com>; blablablabla <email2@domain.com>; blablablabla <email3@domain.com>; blablablabla <email4@domain.com>; blablablabla <email5@domain.com>' consolewrite(_ArrayToString(StringRegExp($string , "\<(.*?)\>" , 3) , @CRLF)) ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
iamtheky Posted January 24, 2018 Posted January 24, 2018 even shorter, and no includes. where you at @mikell , look at this fragile ugliness $string = 'blablablabla <email1@domain.com>; blablablabla <email2@domain.com>; blablablabla <email3@domain.com>; blablablabla <email4@domain.com>; blablablabla <email5@domain.com>' consolewrite(StringRegExpReplace($string , "(.*?)\<(.*?)\>(.*?)|\z;" , "$2" & @CRLF)) ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
ViciousXUSMC Posted January 24, 2018 Posted January 24, 2018 (edited) 29 minutes ago, iamtheky said: shorter... #include<array.au3> $string = 'blablablabla <email1@domain.com>; blablablabla <email2@domain.com>; blablablabla <email3@domain.com>; blablablabla <email4@domain.com>; blablablabla <email5@domain.com>' consolewrite(_ArrayToString(StringRegExp($string , "\<(.*?)\>" , 3) , @CRLF)) This was my first one but it took over 4x the steps to process I was going for regex speed. 26 Steps - https://regex101.com/r/QIHshw/1 200 Steps - https://regex101.com/r/oZ9POp/1 388 Steps - https://regex101.com/r/KUV0Zs/1 Edited January 24, 2018 by ViciousXUSMC
iamtheky Posted January 24, 2018 Posted January 24, 2018 yeah, that one just hides the loop more than removes it. the SRER should be a better stab. ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now