2016-07-26 42 views
3

セレンでAutoItツールを使用しています。私がやっていることは、アプリケーションに「名前を付けて保存」ダイアログボックスが表示されたときに、ファイルがシステムに保存されている既定値を取得することです。私は以下の私のコードで述べたように、それを「New」にリネームしようとしています。しかし、ここで問題になっているのは、ダイアログボックスでファイル名が「新規」に変更されますが、「保存」をクリックすると、デフォルトのファイル名で保存されます。セレンでautoitを使用して名前を付けて保存ダイアログボックスのファイル名を変更します。

$windowHandle = WinGetHandle("Enter name of file to save to…") 
WinActivate($windowHandle) 
ControlSetText("Enter name of file to save to…", "", "Edit1", "New") 
ControlClick("Enter name of file to save to…", "", "Button1") 
+0

、ありがとう! – testing

+0

ControlSetTextの後にEdit1をクリックしてみてください。 – Milos

+0

@Milos、私はあなたが提案したものを試しました、それはうまくいかなかった – testing

答えて

0

これはこれで働いていた:誰もがこの問題で私を助けることができる

$windowHandle = WinGetHandle("Enter name of file to save to…") 
WinActivate($windowHandle) 

ControlSetText("Enter name of file to save to…", "", "Edit1", "2131221") 
ControlClick("Enter name of file to save to…", "", "Edit1") 
ControlSetText("Enter name of file to save to…", "", "Edit1", "5666") 
ControlClick("Enter name of file to save to…", "", "Edit1") 
ControlSetText("Enter name of file to save to…", "", "Edit1", Send(" {BACKSPACE}")) 
ControlSetText("Enter name of file to save to…", "", "Edit1", "New") 
ControlClick("Enter name of file to save to…", "", "Button1") 
関連する問題