public CompletableFuture<?> run() {
    commandStartStopProcessor.startOfScript(getProject());
    isStopRequested = false;

    registryValues.clear();
    UiActivityMonitor activityMonitor = UiActivityMonitor.getInstance();
    activityMonitor.clear();
    activityMonitor.setActive(true);
    currentStageDepth.clear();
    passedStages.clear();
    myContextTimestamp++;

    subscribeListeners(ApplicationManager.getApplication().getMessageBus().connect(onStop));
    Disposer.register(onStop, () -> {
      commandStartStopProcessor.endOfScript(getProject());
      onStop();
    });

    actionCallback = new CompletableFuture<>();
    actionCallback.handle((o, throwable) -> {
      try {
        if (throwable != null) {
          commandStartStopProcessor.scriptCanceled();
        }
      }
      finally {
        Disposer.dispose(onStop);

        SwingUtilities.invokeLater(() -> {
          activityMonitor.setActive(false);
          restoreRegistryValues();
        });
      }
      return null;
    });

    if (!ApplicationManager.getApplication().isHeadlessEnvironment()) {
      try {
        myRobot = new Robot();
      }
      catch (AWTException e) {
        LOG.info(e);
      }
    }

    try {
      commands.addAll(includeScript(myScript, getScriptDir()));
    }
    catch (Exception e) {
      String message = "Failed to parse script commands: " + myScript;
      LOG.error(message, e);
      actionCallback.completeExceptionally(new RuntimeException(message, e));
      return actionCallback;
    }

    new Thread(null, Context.current().wrap(() -> {
      if (useDirectActionCall) {
        executeFrom(0, getScriptDir());
      }
      else {
        IdeEventQueue.getInstance().doWhenReady(Context.current().wrap(() -> executeFrom(0, getScriptDir())));
      }
    }), "playback runner").start();

    return actionCallback;
  }
public CompletableFuture<?> run()