Autohotkey 将inputbox中的文本置于字符串中

Autohotkey 将inputbox中的文本置于字符串中,autohotkey,Autohotkey,我正在寻找一个ahk脚本来执行以下操作: 显示弹出框 输入文本 在弹出框中显示标准文本+字符串 例如,当我按下#r键时,我会得到一个弹出框,我输入Marc,然后得到 “亲爱的马克” 因此,在Java中,它将类似于 var1 = inputBox("whats your name") var NameRegards = function(text){ "dear regards" + var1 } show NameRegards 有人知道我如何在ahk处理这个问题吗?这是一个未经测试的开始 #

我正在寻找一个ahk脚本来执行以下操作:

  • 显示弹出框
  • 输入文本
  • 在弹出框中显示标准文本+字符串
  • 例如,当我按下#r键时,我会得到一个弹出框,我输入Marc,然后得到

    “亲爱的马克”

    因此,在Java中,它将类似于

    var1 = inputBox("whats your name")
    var NameRegards = function(text){
    "dear regards" + var1
    }
    show NameRegards
    

    有人知道我如何在ahk处理这个问题吗?

    这是一个未经测试的开始

    #SingleInstance Force
    #Persistent
    
    Return ; Stop the startup lines otherwise #r will run on startup...
    
    #r:: ; [Win]+r to start this script
    InputBox, MyName, This is your Windows Title, Type your name:
    SendInput, Dear regards`, %MyName% ; Using `(On ~ key on US KB) to literally  print a comma
    ; SendInput, % "Dear regards, " MyName ; Alternative way
    Return
    

    照你说的做怎么样

    InputBox, varName, Name input, What's your name?
    MsgBox , , Output, Dear regards %varName%
    

    对我来说很好。

    你发布的代码不是Java。如果有的话,它看起来像JavaScript。在AHK中实现它到底有什么问题?我是说Javascript。关于如何解决这个问题的建议?关于如何解决什么问题的建议?JavaScript?我看不出还有什么需要修复的…我是说我如何在autohotkey中实现这一点…你试过实现它吗?如果是,你被困在哪里?