Copy link to clipboard
Copied
Hi all
I discovered the very effective batch sequences to deal with many files.
This time I would like to update only one function of my script (that includes many other functions).
So far , I haven't found how to do that with a sequence.
I would appreciate any help.
Thanks in advance
Michel
No. It's:
this.addScript("ScriptName", "ScriptCode");
Copy link to clipboard
Copied
You can't update a specific function. You can set the entire code to the new value, though.
Copy link to clipboard
Copied
That's what I was scare of ! so what's the way to do it ? is it this.script = a string containing the new entire script ?
Copy link to clipboard
Copied
No. It's:
this.addScript("ScriptName", "ScriptCode");
Copy link to clipboard
Copied
ok
many thanks fot this (once again) best response
have a nice day
Copy link to clipboard
Copied
There is a trick you can use, but I don't really recommend it unless you're desperate. Document-level JavaScripts are loaded by alphabetical order when the document is opened, so if you add a new document-level JavaScript that has a name that would load after the one that contains the function you want to remove, you can use the doc.addScript method to add a function that has the same name. The one that is loaded last will be the one that's used when it's subsequently called. The problem is you can't count on this alphabetical loading, though it's always been that way with Acrobat/Reader since JavaScript was introduced in version 3.
Copy link to clipboard
Copied
interresting ! I didn't know how it works.
By the way do you know why empty lines lines are added to my scripts ?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now