2017-06-04 9 views

答えて

0

これはトリックを行うコードです。私はそれを保存していない問題がありました。理由は分かりませんが、既存の文書を保存したい場合があるかもしれません。

var untitledWindow = app.windows["Untitled"] 
    if untitledWindow.exists { 
     untitledWindow.typeKey("w", modifierFlags:.command) 
     //untitledWindow.buttons[XCUIIdentifierCloseWindow].click() should work too 
     if untitledWindow.buttons["Save"].exists{ 
      untitledWindow.buttons["Save"].click() 
     } 
     if untitledWindow.buttons["Replace"].exists { 
      untitledWindow.buttons["Replace"].click() 
     } 
    } 
関連する問題