close

首先,要用VBScript完成輸入文字,需要用到SendKeys指令

在另一篇文章中有使用到 http://orsinobbb.pixnet.net/blog/post/83721429

接下來說明做法:

1. 請先將 新注音 設定快速鍵 Shift + ctrl +2 (輸入法列按右鍵->設定值->按鍵設定->新注音->Shift+Ctrl+2->確定)

2.然後開啟筆記本,並且把下面的文字貼上,再儲存成  "測試.vbs" 檔案類型 "全部"

----------------由此線以下開始複制--------------------------------------------------

Set wshshell=wscript.CreateObject("WScript.Shell")
wshshell.Run "notepad"
wscript.sleep 1000
wshshell.SendKeys "+^2"
wscript.sleep 2000
wshshell.SendKeys "1"
wscript.sleep 1000
wshshell.SendKeys "8"
wscript.sleep 1000
wshshell.SendKeys "4"
wscript.sleep 300
wshshell.SendKeys "1"
wscript.sleep 300
wshshell.SendKeys "8"
wscript.sleep 300
wshshell.SendKeys "4"
wscript.sleep 300
wshshell.SendKeys "j"
wscript.sleep 300
wshshell.SendKeys "i"
wscript.sleep 300
wshshell.SendKeys "3"
wscript.sleep 300
wshshell.SendKeys "9"
wscript.sleep 300
wshshell.SendKeys "4"
wscript.sleep 300
wshshell.SendKeys "s"
wscript.sleep 300
wshshell.SendKeys "u"
wscript.sleep 300
wshshell.SendKeys "3"
wscript.sleep 300
wshshell.SendKeys "{enter}"

----------------複制到此線以上--------------------------------------------------

說明:這裡調用了 VBScript 中的 Sendkeys 來實現模擬鍵盤輸入的動作

         其中的  ^是ctrl   +是shift   %則代表alt     {"ENTER"}則模擬鍵盤迴車鍵

         若對此有興趣歡迎留言發問。(若輸入法沒設好 會打出英文而不是中文了)

arrow
arrow

    小新 發表在 痞客邦 留言(2) 人氣()