I need a script to import the two preset and it doesn't duplicate the presets again run the script. The script need to validate and remove the duplicating preset
Try the following code, it will check if the preset is already loaded if yes it will delete and then load the new preset. Change the filename according to your path
var pp = app.pdfExportPresets.itemByName("Exporter") if(pp.isValid == true) pp.remove() app.importFile(ExportPresetFormat.PDF_EXPORT_PRESETS_FORMAT, File("/Users/manan/Desktop/Exporter.joboptions"))
This is mycode:
But it wont works
Your code is definitely not complete and its not correct even. I will mention points as to what is wrong in it
The code after this incomprensible its convoluted to be precise. What i gave you should suffice for your needs, just change the preset name and the filepath for the joboptions in it and it will work as you asked. To repeat it for multiple files, change it into a function, if that is complex for you then just copy these lines again and do the preset name and path change again and you should be done
That is my mistake I was not clearly mentioned the actual things want.
The real scenario is the two variables pdfSetting1 and pdfSetting2 are two preset to import from my local path and after import into the application to export the pdf again i run the script could not duplicate.
So you want to load a preset? In that case you use:
Then you can reference it by whatever the export name of the file is:
Review the Application DOM object.
I'm hoping that the issue is resolved for you. If any of the above-mentioned solutions or suggestions helped, please mark them correct. If not, do let us know so that we can assist you further.