autohotkey - IF 循环之一无法正常工作,我不知道为什么
问题描述
我在 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
}
提前致谢!ps 如果此信息对我使用热键 (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
推荐阅读
- javascript - 在嵌入式谷歌表单上单击提交时显示弹出/对话框
- apache - .htaccess 如何在网站上显示特定 URL 的 503
- c# - 如何执行“内存”的最小分配转换
'进入'流'? - node.js - 图像预览而不是下载 AWS S3
- javascript - 无法在帖子中获取 req.body.username
- java - 如果任何测试失败,Selenium 如何不阻止测试的执行
- javascript - 无效的挂钩调用。Hooks 只能在内部调用
- html - 尝试将嵌套的 json 文件填充到 html
- c# - C# Web API 错误:套接字连接被中止
- qt - 边框根据矩形宽度改变宽度