Autohotkey 如何将名称转换为自定义电子邮件地址?(即第一个、最后一个、F。Last@xxx...)

Autohotkey 如何将名称转换为自定义电子邮件地址?(即第一个、最后一个、F。Last@xxx...),autohotkey,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 Gu

我每天都要处理成千上万的姓名和电子邮件。我希望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
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
自定义格式(在GUI编辑框中键入所需格式,然后按按钮执行):

自定义格式:

f_last@xxx.com

Input names:

Manuel Antonio G. Lisbona

Nicolas Paillot De Montabert

Output emails:

m_GLisbona@xxx.com

N_DeMontabert@xxx.com

试着这样做:

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
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

如果您提供您尝试过的问题,堆栈溢出将对您更有用。不能完成一段代码没关系,但是你能开始吗?读者有更多的时间来关注那些努力过的人,即使他们没有成功,这为那些仅仅寻求免费劳动的人提供了一个有用的过滤器。