我有这个Windows语音识别(WSRMacro)脚本,它将多个单词组合成一个单词:
"Happy children"
-> "Happychildren"
但是,在某些情况下会出现脚本中的错误,我不知道如何推断出问题所在。虽然上面的示例有效,但以下内容不适用:
"Happy children bake a cake"
而不是复合上面的单词,而是显示Alternates Panel,提示如下:
-> Alternates Panel (Say the number next to the item you want followed by OK):
(1) Replace that withhappychildrenbakeacake
(2) replace that withhappychildrenbakeacake
(3) replace that with no space happy no space
children no space bake no space a no space cake
我可以从上面的Alternates Panel输出中推断出下面脚本中的任何特定错误吗?
或者我可以添加哪些内容来获取有关错误性质的更有用的反馈?
<command priority="5">
<listenFor>compound that</listenFor>
<emulateRecognition>select that</emulateRecognition>
<sendKeys>{250 WAIT}{{CTRL}}c{250 WAIT}</sendKeys>
<script language="VBScript">
<![CDATA[
that = Application.clipboardData.GetData("text")
Set regEx = New RegExp
regEx.Pattern = "[^\s\w,;:]"
If regEx.Test(that) Then
Application.SetTextFeedback("Try again without any punctuation selected")
Else
regEx.Pattern = "(\s) *(\S)"
regEx.Global = True
that = regEx.Replace(" " & that, "$1no space $2")
On Error Resume Next
Application.EmulateRecognition("replace that with" & that)
If 0 <> Err.Number Then
Application.SetTextFeedback("Try again with only the digits selected")
End If
End If
]]>
</script>
</command>
答案 0 :(得分:0)
听起来你正试图在一个本身不支持Text Services Framework的应用程序中使用它。
更严重的是,为什么你不使用内置命令'从中删除空格'或'连接那个'?