   "tell application \"System Events\" to tell process \"Cisco AnyConnect Secure Mobility Client\"\n" +
   "if button \"Disconnect\" of window 1 exists then\n" +
     "click button \"Disconnect\" of window 1\n" +
-    "return\n" +
+    "return 1\n" +
   "end if\n" +
   "tell combo box 1 of window 1 to set value to \"%@\"\n" +
   "click button \"Connect\" of window 1\n" +

  }
}

func connect(password: String?, toNetwork network: String?) -> Result<NSAppleEventDescriptor, QCError> {
  return validatePassword(password) &&& validateNetwork(network)
    >>- createScript
    >>- executeScript
}

func eval<T>(result: Result<T, QCError>, success: (T -> ())? = { print($0) }, fail: (QCError -> ())? = printErrorAndExit) {
  switch result {
  case let .Success(res): success?(res)
  case let .Failure(error): fail?(error)
  }
}


}

let arguments = Process.arguments
var defaults = Keychain(identifier: "qc")

let usage =
  "usage: qc \t\t\t\tConnect to the saved network\n" +
