我经常使用 SEO,所以我为自己创建了一个快速检查网站的快捷方式,问题是由于某种原因,函数中的第二个 IF 语句无法正常工作(如果我输入“seo”,它会询问我的域我想检查并正常运行,但如果我输入“whois”,输入框不会弹出,它会直接跳转到 whois.domaintools.com 网站(没有 URL 扩展名)
这是我到目前为止所做的代码
collectAction(){
InputBox, userAction, ,Which action would you like to perform?, , 300, 120, ,, Arial,
if(userAction="seo")
InputBox, seoUrl, ,Please enter the domain you want to check., , 300, 120, ,, Arial,
Run, https://freetools.seobility.net/en/seocheck/check?url=https`%3A`%2F`%2Fwww.%seoUrl%`%2F&crawltype=1
return
if(userAction="whois")
InputBox, whoisUrl, ,Please enter the domain you want to check., , 300, 120, ,, Arial,
Run, https://whois.domaintools.com/%whoisUrl%
return
}
提前致谢! p.s 如果此信息对我使用热键 (F1) 调用此函数的过程有任何影响
将两个连续的 if 语句更改为 if - else 有效
collectAction(){
InputBox, userAction, ,Which action would you like to perform?, , 300, 130, ,, ,
if(userAction="seo") {
InputBox, seoUrl, ,Please enter the domain you want to check., , 300, 120, ,, ,
Run, https://freetools.seobility.net/en/seocheck/check?url=https`%3A`%2F`%2Fwww.%seoUrl%`%2F&crawltype=1
return
}
else if(userAction="whois") {
InputBox, whoisUrl, ,Please enter the domain you want to check., , 300, 120, ,, ,
Run, https://whois.domaintools.com/%whoisUrl%
return
}
}
函数调用示例:
F1::
collectAction()
return
您需要将命令包装在 {} 块之间的 if 子句中
collectAction(){
InputBox, userAction, ,Which action would you like to perform?, , 300, 120, ,, Arial,
if(userAction="seo") {
InputBox, seoUrl, ,Please enter the domain you want to check., , 300, 120, ,, Arial,
Run, https://freetools.seobility.net/en/seocheck/check?url=https`%3A`%2F`%2Fwww.%seoUrl%`%2F&crawltype=1
return
} ; end if
if(userAction="whois") {
InputBox, whoisUrl, ,Please enter the domain you want to check., , 300, 120, ,, Arial,
Run, https://whois.domaintools.com/%whoisUrl%
return
} ; end of if
} ; end of function