自动热键脚本不会在Lotus Notes中发送键击

时间:2019-09-10 11:14:01

标签: autohotkey lotus-notes

我编写的用于在IBM Lotus Notes中为我写电子邮件的自动热键脚本对我来说很好用,但是当我将该脚本共享给其他同事使用时,击键将不会发送他们的IBM Lotus Notes。当我在Microsoft Word中使用该脚本时,该脚本将起作用,但是,它们将无法在IBM Lotus Notes上运行。 Lotus Notes上是否存在允许发送击键宏的设置? autohotkey中是否有一种语法可以使其绕过限制?

我在脚本前添加了以下标签,但没有运气: InstallKeybdHook,UseHook开启,NoEnv,警告

由于公司防火墙阻止了我们的访问,我无法在管理员上运行脚本

我尝试将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

1 个答案:

答案 0 :(得分:0)

您看过控制命令吗?

ControlSend,控件,键,WinTitle,WinText,ExcludeTitle,ExcludeText

GuiControl,SubCommand,ControlID,值

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

使用BlockInput时要小心。确保在“ Block Input On”命令后,您的代码不会卡在循环中。