Hi @Lordrhavin , Rather than use new PDFExportPreset(), try app.pdfExportPresets.add()—if you use new PDFExportPreset(), then the exportFile() parameter should be myPDFExportPreset.name.
But you want to watch out for adding a new, unnamed preset everytime you run the script, or you’ll get this:

I use something like this to create new or temporary presets:
var doc = app.activeDocument;
if (doc.saved) {
var fp = doc.filePath + "/" + doc.name.replace(/\.[^\.]+$/, '') + ".pdf"
//make a temporary preset from the default PDF/X-4 preset
var preset = makePDFPreset("TempPDF", app.pdfExportPresets.itemByName("[PDF/X-4:2008]"));
//adjusted properties
preset.properties = {exportLayers:true, exportNonprintingObjects:true, exportWhichLayers:ExportLayerOptions.EXPORT_VISIBLE_LAYERS, generateThumbnails:true, pdfDisplayTitle:PdfDisplayTitleOptions.DISPLAY_DOCUMENT_TITLE}
//export
doc.exportFile(ExportFormat.pdfType, File(fp), false, preset);
//remove the created preset after export?
preset.remove()
} else {
alert("Document Not Saved")
}
/**
* Gets an existing PDF preset, or makes a new named PDF Preset based on an existing preset
* @ param the preset name
* @ param bo, an existing preset
* @ return the pdf preset
*/
function makePDFPreset(n, bo){
var ps = app.pdfExportPresets.itemByName(n);
if (ps.isValid) {
return ps;
} else {
ps = app.pdfExportPresets.add({name:n});
ps.properties = bo.properties;
return ps;
}
}