如何将名称转换为自定义电子邮件地址? (即 First.Last、F.Last@xxx...)

How to convert names to custom email addresses? (I.e. First.Last, F.Last@xxx...)

我每天处理成千上万的姓名和电子邮件。我希望 autohotkey 可以做这个庞大的数据。如何创建可以将名称转换为自定义电子邮件格式的脚本? autohotkey学了一个月了,自己写还是太难了

例如我有一个这样的 GUI:

Gui Add, Text, x14 y18 w78 h36 +0x200, Email Format

Gui Add, Edit, x107 y17 w94 h37, f.last

Gui Add, Button, x312 y14 w43 h40, &OK

Gui Add, Edit, x207 y17 w93 h37, @xxx.com

Gui Show, w331 h80, Window

Return

GuiEscape:

GuiClose:

ExitApp

自定义格式(在 GUI 编辑框中键入所需格式,然后按按钮执行):

first.last@xxx.com

Input Names:

Albert van de Bill

Jesús Sánchez-Quiñones

Output emails:

albert.vandebill@xxx.com

Jesus.Sanchez-Quinones@xxx.com

自定义格式:

f_last@xxx.com

Input names:

Manuel Antonio G. Lisbona

Nicolas Paillot De Montabert

Output emails:

m_GLisbona@xxx.com

N_DeMontabert@xxx.com

尝试这样的事情:

Names1 = 
(
Albert van de Bill
Jesús Sánchez-Quiñones
)

Loop, Parse, Names1, `n
    Names .= A_LoopField . "|"
Names := SubStr(Names, 1, -1)

Gui, 1: +ToolWindow
Gui, 1: Add, ListBox, x6 y7 w200 h70 vList gList, %Names%
Gui, 1: Add, Button, x220 y22 w50 h20 gfirst_last, first_last
Gui, 1: Show, h80 w310, convert name to first.last@xxx.com

; Here or in another script you can create another GUI (Gui, 2) for the f_last format in other names (Names2).

Return

List:
if (A_GuiEvent = "DoubleClick")
{
    GuiControlGet, List
    first_last(List)
}
return

first_last:
    GuiControlGet, List
    first_last(List)
Return

first_last(Input_Name){
    toReplace := {"á":"a" , "ñ":"n" , "ú":"u" , "van de ":"vande" , ". ":"" , " ":"." , "van.de.":"vande"}
    For each, string in toReplace
        Input_Name := StrReplace(Input_Name, each, string)
    MsgBox, "%Input_Name%@xxx.com"
}

Esc::
GuiClose:
ExitApp