06-06-2017 01:03 PM
hi everybody, may u plz help me, im not programmer and im really suffering with scripts, i need to convert a txt file into pdf then rename it or add "copy" to the name, to avoid duplication in the same space, the convertion is not the problem, my problem is to rename the file, i want to run a script that acts in this way: if the pdf file exists then the new one being created from the conversion have to be renamed but i dont know how to do it.
i know, probably is not a big issue but for me is taff, so plz help me......
06-15-2017 11:55 AM
pdfName should be set to the name your pdf will get - I think in your script it's
pdfName=document.name+".pdf";
If you don't need the old versions of the text or PDF files, the script could be much simpler. Renaming a file is done just by setting it's name property to a new value.
See the documentation ScriptNode API | Alfresco Documentation
pdfNode.name="the new name.pdf";
06-15-2017 01:01 PM
06-15-2017 01:08 PM
no offense 🙂 - I really was glad that the answer helped someone. It's a community and using and combining solutions is the right thing to do. I just thought you didn't know about the "code box" with syntax highlighting which I discovered just a few weeks ago (also by the help of the community) because it's "hidden" under the "more" menu-option...
Explore our Alfresco products with the links below. Use labels to filter content by product module.