Function SetDefaultFilename

  • Generates a default filename based on the provided filepath, engine, and quantity.

    Parameters

    • filepath: string

      The path of the file.

    • engine: AioTextProcessorMethods

      The engine used for processing.

    • Optionalqty: number

      The quantity of files to generate names for. If greater than 0, an array of filenames is returned.

    Returns string

    • The default filename or an array of default filenames.
    // Returns "translate_myFile.txt"
    SetDefaultFilename("myFile.docx", "translate");
    // Returns ["myFile_translate_1.txt", "myFile_translate_2.txt", "myFile_translate_3.txt"]
    SetDefaultFilename("myFile.pdf", "translate", 3);
    • If the file extension is 'docx' or 'pdf', it's temporarily changed to '.txt'.
    • If qty is greater than 0, it generates an array of filenames with an index.
    • Otherwise, it generates a single filename.