datatek Posted October 27, 2008 Posted October 27, 2008 I am making a script that adds active directory users in Windows Server 2003. If a user's name is John Smith, the username would be j.smith If a user's name is Jane Doe, the username would be j.doe and so on. How do I get Auto It to make this conversion?
Andreik Posted October 27, 2008 Posted October 27, 2008 I am making a script that adds active directory users in Windows Server 2003. If a user's name is John Smith, the username would be j.smith If a user's name is Jane Doe, the username would be j.doe and so on. How do I get Auto It to make this conversion? Func Convert($NAME) Local $RESULT = "" $SPLIT = StringSplit($NAME," ") If IsArray($SPLIT) Then $RESULT = StringLower(StringLeft($SPLIT[1],1) & "." & $SPLIT[2]) EndIf Return $RESULT EndFunc MsgBox(0,"John Smith",Convert("John Smith")) MsgBox(0,"Jane Doe",Convert("Jane Doe"))
datatek Posted October 27, 2008 Author Posted October 27, 2008 (edited) How can I get it that the user types in the name that is then converted? And the resultant username should be a variable that can then be "send()"ed to the OS. Edited October 27, 2008 by datatek
dbzfanatic Posted October 27, 2008 Posted October 27, 2008 You really need to do a bit of research,people aren't going to hold your hand forever. $name = InputBox("Name","Input Name: ","") $converted = Convert($name) Send($converted) Func Convert($NAME) Local $RESULT = "" $SPLIT = StringSplit($NAME," ") If IsArray($SPLIT) Then $RESULT = StringLower(StringLeft($SPLIT[1],1) & "." & $SPLIT[2]) EndIf Return $RESULT EndFunc Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
datatek Posted October 28, 2008 Author Posted October 28, 2008 You really need to do a bit of research,people aren't going to hold your hand forever. I don't need anyone to hold my hand, but if my own research doesn't answer my question, then I don't see a problem with posting in a SupporT forum. $voller_name = ($vorname & " " & $nachname) $Name_conv = StringLower(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace($voller_name,"ü","ue"),"ö","oe"),"ä","ae"),"ß","ss"),"Ü","Ue"),"Ö","Oe"),"Ä","Ae")) If StringInStr($Name_split[$Name_split[0]], '-') Then $var = StringSplit($Name_split[$Name_split[0]], '-') $Name_split[$Name_split[0]] = $var[$var[0]] EndIf $bname = StringLeft($Name_split[1], 1) & "." & $Name_split[$Name_split[0]] In the above code first name and surname are split and, if there is a hypen in the name, the second part selected for $bname. I need to have the first part before the hypen, instead of the second. Could someone help?
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