【问题标题】:Autohotkey Script won't send keystrokes in Lotus notesAutohotkey 脚本不会在 Lotus 笔记中发送击键
【发布时间】:2019-09-13 02:31:34
【问题描述】:

我为在 IBM Lotus Notes 中写出电子邮件而编写的自动热键脚本对我来说效果很好,但是当我将脚本分享给我的其他同事使用时,击键不会发送到他们的 IBM Lotus Notes。当我在他们的 microsoft word 中使用该脚本时,该脚本将起作用,但是,它们不适用于 IBM Lotus notes。 Lotus notes 上是否有允许发送击键宏的设置? autohotkey 中是否有可以绕过限制的语法?

我在脚本前添加了以下带有主题标签的内容,但仍然没有运气: InstallKeybdHook、UseHook On、NoEnv、Warn

我无法以管理员身份运行脚本,因为公司防火墙阻止了我们的访问

我尝试将 SendInput 更改为 SendPlay 和 SendEvent

^d::
row := 2 
wbk := 
ComObjGet("C:\Users\xxxx\Desktop\target\excelfile.xlsx").Sheets("sheet1")

email := wbk.Cells(row, 3).Value
companyname := wbk.Cells(row, 1).Value
personname := wbk.Cells(row, 2).Value
subject := wbk.Cells(2, 1).Value
emailpart := wbk.Cells(2, 3).Value

;Enter sender name
SendInput, % email

;Enter subject
Send, {Tab}{Tab}{Tab}
SendInput, % subject
SendInput, % companyname
Send, {Tab}

;Enter email
Send, Hi{Space}
SendInput, % personname
Send, ,{Enter}{Enter}
SendInput, % emailpart 
Send, {Enter}

row++
Return

【问题讨论】:

  • 我每天在 Notes 中使用 autothotkey,使用 Send 没有任何问题,但是我没有从电子表格中获取值。我当然不知道 Notes 中有任何限制以防止发送击键,所以我怀疑您的问题可能出在其他地方。
  • @PhilMJones 感谢您的帮助,我认为问题不在于从电子表格中获取值,它适用于 microsoft word 和其他程序,以及我的工作计算机。也许您的 ComObjGet 之路已经走下坡路?
  • 为了帮助缩小问题范围,邮件正文中的简单Send, Hello World 是否有效? (即发送到 Notes 或其他东西的密钥是否存在问题?)

标签: autohotkey lotus-notes


【解决方案1】:

你看过控制命令吗?

ControlSend , Control, Keys, WinTitle, WinText, ExcludeTitle, ExcludeText

GuiControl、子命令、ControlID、值

当我使用基本的发送命令时,我通常在发送之前使用 BlockInput On,之后使用 BlockInput Off。

小心使用 BlockInput。确保您的代码在执行 Block Input On 命令后不会陷入循环。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-17
    • 1970-01-01
    • 2018-05-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多