Autohotkey AHK:将名称替换为电子邮件
我已经创建了一个模板,用于向我创建的新用户的客户发送电子邮件 当前代码要求删除空格并添加句点。例如:约翰·史密斯将变成约翰。Smith@test.com 我想创建一个脚本来删除空格和字母,直到创建第一个字母为止JSmith@test.com 以下是我当前的脚本:Autohotkey AHK:将名称替换为电子邮件,autohotkey,Autohotkey,我已经创建了一个模板,用于向我创建的新用户的客户发送电子邮件 当前代码要求删除空格并添加句点。例如:约翰·史密斯将变成约翰。Smith@test.com 我想创建一个脚本来删除空格和字母,直到创建第一个字母为止JSmith@test.com 以下是我当前的脚本: InputBox, ClientE, Client Name, Please type the name of Company if ClientE = test { EmailE = test.com } if (A_ho
InputBox, ClientE, Client Name, Please type the name of Company
if ClientE = test
{
EmailE = test.com
}
if (A_hour >= 12) {
InputBox, UserID, User's Name, Please type the user's name
InputBox, PASSWE, Password, Please type the password
sleep, 700
Send, Good Afternoon ,{Enter 2}This e-mail is to inform you that the requested new user account for{space}
Send, ^b
Send, %UserID%
Send, ^b
Send, {space}has been created as follows;{ENTER 2}
StringReplace, UserID, UserID, %A_SPACE%, . , All
Send, Desktop user name = %UserID% {ENTER}E-mail address = %UserID%@%EmailE%{SPACE} {ENTER}Password = {SPACE}{ENTER 2}Please let me know if you need anything further.{ENTER 2}Best regards,{ENTER 2}Garrett Haggard
}
else
{
InputBox, UserID, User's Name, Please type which user
sleep, 700
Send, Good Morning ,{Enter 2}This e-mail is to inform you that the requested new user account for{space}
Send, ^b
Send, %UserID%
Send, ^b
Send, {space}has been created as follows;{ENTER 2}
StringReplace, UserID, UserID, %A_SPACE%, . , All
Send, Desktop user name =
Send, ^b
Send, %UserID%
Send, ^b
Send, {ENTER}E-mail address = %UserID%@%EmailE%{SPACE} {ENTER}Password =
Send, ^b
Send, %PASSWE%
Send, ^b
Send, {SPACE}{ENTER 2}Please let me know if you need anything further.{ENTER 2}Best regards,{ENTER 2}
}
return
以下是代码和更新/附加的scrit
{
if (A_hour >=12)
{
RTYH = Good Afternoon
}
Else
{
RTYH = Good Morning
}
InputBox, ClientE, Client Name, Please type the name of Company
InputBox, UserID, User's Name, Please type the user's name
;InputBox, PASSWE, Password, Please type the password
sleep, 700
Send, %RTYH% ,{Enter 2}This e-mail is to inform you that the requested new user account for{space}
Send, ^b
Send, %UserID%
Send, ^b
Send, {space}has been created as follows;{ENTER 2}
if ClientE = test
{
UserID := UserID
stringSplit, user_first_last, UserID, %A_Space%
StringLeft, first_initial, user_first_last1, 1
UserID4 := first_initial . user_first_last2
UserID5 := first_initial . user_first_last2 . "@test.com"
}
if ClientE = testing
{
UserID := UserID
stringSplit, user_first_last, UserID, %A_Space%
StringReplace, UserID4, UserID, %A_SPACE%, . , All
UserID4 := UserID4
UserID5 := UserID4 . "@testing.com"
}
Send, Desktop user name =
Send, ^b
Send, %UserID4%
Send, ^b
Send, {ENTER}E-mail address = %UserID5%{SPACE} {ENTER}Password ={SPACE}{ENTER 2}Please let me know if you need anything further.{ENTER 2}Best regards,{ENTER 2}
}
return
谢谢!我不得不改变我的代码来实现这一点,对脚本进行了明显的编辑。但是我让它工作得很好!
UserID := "John Smith"
stringSplit, user_first_last, UserID, %A_Space%
StringLeft, first_initial, user_first_last1, 1
email := first_initial . user_first_last2 . "@test.com"
msgbox, %email%
return
{
if (A_hour >=12)
{
RTYH = Good Afternoon
}
Else
{
RTYH = Good Morning
}
InputBox, ClientE, Client Name, Please type the name of Company
InputBox, UserID, User's Name, Please type the user's name
;InputBox, PASSWE, Password, Please type the password
sleep, 700
Send, %RTYH% ,{Enter 2}This e-mail is to inform you that the requested new user account for{space}
Send, ^b
Send, %UserID%
Send, ^b
Send, {space}has been created as follows;{ENTER 2}
if ClientE = test
{
UserID := UserID
stringSplit, user_first_last, UserID, %A_Space%
StringLeft, first_initial, user_first_last1, 1
UserID4 := first_initial . user_first_last2
UserID5 := first_initial . user_first_last2 . "@test.com"
}
if ClientE = testing
{
UserID := UserID
stringSplit, user_first_last, UserID, %A_Space%
StringReplace, UserID4, UserID, %A_SPACE%, . , All
UserID4 := UserID4
UserID5 := UserID4 . "@testing.com"
}
Send, Desktop user name =
Send, ^b
Send, %UserID4%
Send, ^b
Send, {ENTER}E-mail address = %UserID5%{SPACE} {ENTER}Password ={SPACE}{ENTER 2}Please let me know if you need anything further.{ENTER 2}Best regards,{ENTER 2}
}
return