SendKey命令vbscript失败

SendKey命令vbscript失败,vbscript,Vbscript,我是vbscript新手,这是我的第一个脚本之一。我试图做的是在chrome中自动打开PDF文件,复制其内容并粘贴到一个新的.txt文件 Set objShell = WScript.CreateObject("WScript.Shell") Set objFSO=CreateObject("Scripting.FileSystemObject") 'opening the pdf file (path stored in the 'path' variable) objShell.Run "

我是vbscript新手,这是我的第一个脚本之一。我试图做的是在chrome中自动打开PDF文件,复制其内容并粘贴到一个新的.txt文件

Set objShell = WScript.CreateObject("WScript.Shell")
Set objFSO=CreateObject("Scripting.FileSystemObject")

'opening the pdf file (path stored in the 'path' variable)
objShell.Run """C:\Program Files(x86)\Google\Chrome\Application\chrome.exe"" """ & path & """"
'waiting for chrome to open
WScript.Sleep 6000

'sending ctrl+a & ctrl+c to copy all the text
objShell.SendKeys "^a"
objShell.SendKeys "^c" 

'creating a new text file, path stored in the 'NewFile' variable
objFSO.CreateTextFile NewFile,True

'opening the new file with notepad 
objShell.run """C:\WINDOWS\system32\notepad.exe"" """ & NewFile & """"

'waiting for notepad to open
WScript.Sleep 5000

'sending ctrl+a, ctrl+v and ctrl+s to paste and save
objShell.SendKeys "^a"
objShell.SendKeys "^v"
objShell.SendKeys "^s"
但由于某种原因,该文件包含我以前复制的内容,^c不起作用,尽管^s起作用(我可以看到文本已被选中)。我用shift+F10进行了尝试,没有看到任何改进,尽管当我尝试手动操作时,它工作得非常好

我不必通过chrome复制PDF,但使用adobe处理程序不是我的选择


我将感谢任何帮助

尝试使用Internet Explorer而不是chrome。谢谢您的评论,但Internet Explorer不支持^a快捷方式,因此它不适合我的需要…我刚刚尝试了您的代码,将chrome更改为IE(版本:8。这是我仅有的一个版本),它似乎可以工作。如果您手动尝试,
^a
对您不起作用吗?请尝试使用Internet Explorer而不是chrome。谢谢您的评论,但Internet Explorer不支持^a快捷方式,因此它不适合我的需要…我刚刚尝试了您的代码,将chrome更改为IE(版本:8。这是我仅有的一个版本),它似乎可以工作。如果您手动尝试,
^a
是否对您有效?