Script Collection
Microsoft Access
Controlling applications via sendkeys | Controlling applications via sendkeys |
|
|
|
|
With sendkeys (Python/Pywin32 uses WScript from Windows Scripting Host) one can control applications via shortcuts. eg. This example first opens Microsoft Outlook, takes the first element, marks the full text and takes it into the clipboard (CTRL + C). import win32com.client shell = win32com.client.Dispatch("WScript.Shell") shell.Run("outlook") shell.AppActivate("Outlook") shell.SendKeys("^o", 0) # 1 für Pause = true 0 für nein shell.SendKeys("^a", 0) shell.SendKeys("^c", 0)Here is a list of WScript-commands:
Steuerung, Shift, ALT und Enter werden wie folgt gesendet:
The documentation of Sendkeys you can find at Microsoft. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Last Updated ( Tuesday, 04 March 2008 ) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Next > |
|---|
Hint: For syntax highlighting and correct Python intendation place your code between html tags <pre> and </pre>.