§ÚÌ¥i¥H¨Ï¥Î sendKeys() ¨ç¼Æ¨Ó¶Ç°eÁä½L¨Æ¥ó¡A³o¬O¤@ӫܱj¤jªº¥\¯à¡A¥ô¦ó³nÅé¥un¯à°÷¤ä´©¨Ï¥Î¼öÁä¨Ó¾Þ§@¡A§ÚÌ´N¥i¥H¨Ï¥Î WSH ¨Ó¹F¨ì¤@¼Ò¤@¼Ëªº¥\¯à¡C
¦b¤U±³oÓ½d¨Ò¡A§Ú̶}±Ò IE ¨Ã°õ¦æ¦C¦Lªº°Ê§@¡G
½Ðª`·N¦b¤Wz½d¨Ò¤¤¡A
- WshShell.SendKeys("%{f}") ¥Nªí°õ¦æ Alt-f «öÁä¡AWshShell.SendKeys("p") ¥Nªí°õ¦æ«öÁä p¡A¦Ó WshShell.SendKeys("{ENTER}") ¥Nªí°õ¦æ«öÁä Enter¡A¨Ì¦¹Ãþ±À¡C
- §ÚÌ´¡¶i¥h¤F¦n´X¦C WScript.Sleep(5000)¡A´N¬O§Æ±æ¦b«öÁä«á¡A¥ýµ¥Ô 5 ¬íÄÁ¡A¥H«K¨Ï¾ã¹L¾Þ§@¹Lµ{§ó¥[éw¡C
- ¦bµ{¦¡½X°õ¦æ¹Lµ{¤¤¡A½Ð¤ÅÂI¿ï¨ä¥Lµøµ¡¡A¥HÁקKÁä½L¨Æ¥ó³Q°e¨ì¿ù»~ªºµøµ¡¡C
¥H¤U¦C¥X¤@¨Ç¯S®í«öÁ䪺¬ÛÃö©I¥s¤è¦¡¡G
«öŲ | ©I¥s¤è¦¡
| SHIFT | +
| CONTROL | ^
| ALT | %
| LEFT ARROW | {LEFT}
| RIGHT ARROW | {RIGHT}
| UP ARROW | {UP}
| DOWN ARROW | {DOWN}
| { | {{}
| } | {}}
| [ | {[}
| ] | {]}
| ~ | {~}
| + | {+}
| ^ | {^}
| % | {%}
|
|
«öŲ | ©I¥s¤è¦¡
| BACKSPACE | {BACKSPACE}, {BS}, or {BKSP}
| BREAK | {BREAK}
| CAPS LOCK | {CAPSLOCK}
| DEL or DELETE | {DELETE} or {DEL}
| END | {END}
| ENTER | {ENTER} or ~
| ESC | {ESC}
| HELP | {HELP}
| HOME | {HOME}
| INS or INSERT | {INSERT} or {INS}
| NUM LOCK | {NUMLOCK}
| PAGE DOWN | {PGDN}
| PAGE UP | {PGUP}
| PRINT SCREEN | {PRTSC}
| SCROLL LOCK | {SCROLLLOCK}
| TAB | {TAB}
|
|
«öŲ | ©I¥s¤è¦¡
| F1 | {F1}
| F2 | {F2}
| F3 | {F3}
| F4 | {F4}
| F5 | {F5}
| F6 | {F6}
| F7 | {F7}
| F8 | {F8}
| F9 | {F9}
| F10 | {F10}
| F11 | {F11}
| F12 | {F12}
| F13 | {F13}
| F14 | {F14}
| F15 | {F15}
| F16 | {F16}
|
|
§Ṳ́]¥i¥H¶}±Ò°O¨Æ¥»¨Ã¼g¤J¤å¦r¡G
¤Wz½d¨Ò¬O¤@ӫܦ³½ìªº½d¨Ò¡AŪªÌ¤@©wn¿Ë¦Û¸Õ¬Ý¬Ý¡A¤~¯àÅé·|¨Ï¥ÎWSHªº¡u¶Ç°eÁä½L¨Æ¥ó¡v¥i¥H¹F¨ìªº±j¤j¥\¯à¡I
Yn¶}±Ò IE ¨Ã³]©w¹w³]ºô¶¡A¥i¨£¤U¦C½d¨Ò¡G
¦b¤Uz½d¨Ò¤¤¡A§Ú̧Q¥Î°O¨Æ¥»Åª¤J¤@Ó¤å¦rÀÉ¡A±N¤å¦rÀɪº½s½X¤è¦¡§ï¦¨ UTF-8¡A¨Ã¥t¦s·sÀÉ¡A¦p¤U¡G
Yn´ú¸Õ¤U¦C½d¨Ò¡AŪªÌ¥i¥H¿é¤J
cscript toUtf8.js test.txt
¦¹®É WSH ·|¨Ï¥Î°O¨Æ¥»¨ÓŪ¤J test.txt¡A±N¨ä½s½X§ï¬° UTF-8¡A¨Ã¥t¦s¦¨ test.txt_utf8¡CYnÀ˵ø³o¨âÓÀɮתº¤£¦P¡A¥i¥Îºô¶ÂsÄý¾¹¨ÓÅã¥Ü³o¨âÓÀɮסA¨Ã¥Ñ¤U©Ô¿ï³æ¡uÀ˵ø/½s½X¡v¡A´N¥i¥H¬Ý¥X³o¨âÓÀɮצb½s½X¤Wªº¤£¦P¡C
¨ä¥L»P¶Ç°eÁä½L¨Æ¥óªº¬ÛÃö»¡©ú¡A¥i¨£·L³nªº©x¤èºô¶¡G
http://www.microsoft.com/technet/scriptcenter/guide/sas_wsh_hilv.mspx?mfr=true
JScript µ{¦¡³]p»PÀ³¥Î¡G¥Î©ó³æ¾÷ªº WSH Àô¹Ò