2011-12-30 124 views
1

我試圖自動將Lotus Notes電子郵件導出到Microsoft XPS文檔,以便能夠搜索它們。如何選擇打印機並使用AutoHotKey進行打印

現在我想通過使用AutoHotKey打印並在打印機名稱列表中選擇「Microsoft XPS文檔」來自動導出。

我有以下腳本:

; F2 is my chosen HotKey that will trigger the script, starting with a CTRL-P 
*F2::^p 

; type 'm' to choose 'Microsoft XPS Document Printer' 
Send m 
{enter} 
這將打開打印預覽窗口,但不會選擇打印機,雖然手動鍵入「M」

工作。我嘗試了睡眠,但也沒有工作。

回答

2

首先,你的第二個命令永遠不會執行。當您將命令放在與啓動代碼相同的行時。即使執行第二個命令,它也可能太快。試試這個:

F2:: ; Use the F2 key (I would use F1 as I never use the help key) 
Send, ^p ; Send Control P to print 
Sleep, 1000 ; wait 1 second (or less) for print dialoguebox 
Send, m ; Select printer type 
Sleep, 100 ; Wait 0.1 sec. before pressing enter 
Send, {Enter} ; Press enter 
Return ; End this command 

問候,

羅伯特Ilbrink

+0

非常好。有用。非常感謝你。 – tucson 2012-01-02 11:14:32

相關問題