Function WriteTextFilesPrompt

  • Prompts the user to confirm if they want to save the content to a file and, if so, to enter the file's name.

    Parameters

    • filepath: string | string[]

      The path of the file or an array of file paths.

    • engine: AioTextProcessorMethods

      The engine used for processing.

    • Optionalmultiple: number | boolean = false

      Indicates if multiple files are being processed. If a number, it represents the quantity of files.

    Returns Promise<string | undefined>

    • The filename entered by the user, or undefined if the user chooses not to save.
    // Prompts the user to confirm saving and enter a filename.
    // If the user confirms and enters "myOutput.txt", it returns "myOutput.txt".
    // If the user declines, it returns undefined.
    await CreateWriteFilePrompt("myInput.txt", "translate");
    // Prompts the user to confirm saving and suggests default filenames based on the quantity.
    // If the user confirms, it returns the filename entered by the user.
    // If the user declines, it returns undefined.
    await CreateWriteFilePrompt("myInput.pdf", "translate", 3);