These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Is there a way to "refresh" folder-level scripts?

mvivit
Registered: Nov 5 2008
Posts: 46
Answered

I'm having a tough time updating folder-level scripts. I've closed Acrobat, copied the updated .js script file into the appropriate folder (replacing the previous one), opened Acrobat again, and tried to run the script. But Acrobat insists on running the previous version of the script. I've even removed the file from the folder, restarted Acrobat, and Acrobat still runs the previous version. I can verify the change very easily, so I'm sure the problem has to do with loading the newer version of the script.

Any ideas? Thanks for the help!

My Product Information:
Acrobat Pro 8.1.2, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Are you sure the scirpt is not also located in another application level foler?

To find your application and user JavaScript folders:

try {
var appJS = app.getPath("app", "javascript");
} catch(e) {
var appJS = "No path for application JavaScripts";
}
console.println("Application JavaScript folder: " + appJS);

try {
var userJS = app.getPath("user","javascript");
} catch(e) {
var userJS = "User has not defined any custom JavaScripts";
}
console.println("User JavaScript folder: " + userJS);

George Kaiser

mvivit
Registered: Nov 5 2008
Posts: 46
Thanks for the reply! The scripts are only in the user Javascripts folder. I have my working copies on a network drive, and I've done a successful compare between the script files in the two locations.

What's driving me particularly nuts is I was dropping files in and out of the user Javascripts folder yesterday without a hitch. Now today Acrobat is refusing to "forget" the older scripts. Even the console seems to be caching scripts from the prior session.
mvivit
Registered: Nov 5 2008
Posts: 46
Here's something else strange...one of these scripts adds a menu item to the Forms menu. I closed Acrobat, deleted the .js file from the folder, and restarted Acrobat. Sure enough, the menu item is still available.
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
And you are sure the scripts in the user folder are being updated and there is no second copy in another JS file?

George Kaiser

mvivit
Registered: Nov 5 2008
Posts: 46
"Yes" on both counts. Thanks for asking.
mvivit
Registered: Nov 5 2008
Posts: 46
I figured it out (with a little help from the regular Adobe Forums). I had to close not only Acrobat but all all my browser windows as well. Apparently Acrobat only reads the Javascript files upon initialization. To be honest, I don't remember how many (if any) browser windows I had open yesterday while I was working on it. I'm sure I had at least one browser open (I have at least two browser applications open for testing usually). Thanks for all the help!
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
If you have the web browser Reader plug-in enabled, then Acrobat/Reader is running withou the GUI appliction.

George Kaiser

mvivit
Registered: Nov 5 2008
Posts: 46
That makes a lot of sense. In any case, thanks for the help! I just need to remember to close my browser instances when I work on scripts.
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
mvivit wrote:
I'm having a tough time updating folder-level scripts. I've closed Acrobat, copied the updated .js script file into the appropriate folder (replacing the previous one), opened Acrobat again, and tried to run the script. But Acrobat insists on running the previous version of the script. I've even removed the file from the folder, restarted Acrobat, and Acrobat still runs the previous version. I can verify the change very easily, so I'm sure the problem has to do with loading the newer version of the script.Any ideas? Thanks for the help!
Hi,

I have the same problem sometimes.
As far as I could figure it out, this was caused by a still running Acrobat-process in the taskmanager although all application have been visually been closed.
It's not always the same process but often it's a Cleanup process by Adobe, that hangs up or takes too long to shut down.
When I kill the process and reopen Acrobat the new JS is working well.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

mvivit
Registered: Nov 5 2008
Posts: 46
You're right, radzmar. The majority of my work relies on having multiple browser windows open, so I hate closing everything just to work on scripts. I would *love* to have an option somewhere within Acrobat (standalone pro) allowing me to update my scripts without having to do a lot of hoop-jumping. Ah well...I guess I can always hope for the future.
asmohr
Registered: Sep 2 2007
Posts: 25
Thanks mvivit, radzmar,

This was driving me crazy too. I could return a .js script file to exactly the state that it had been in when it worked, and suddenly it was not working. After several late night hours, I checked that it was, yes, still not working, and went to bed. In the morning, it worked. The computer had rebooted during the night.

I will keep an eye out for Acrobat processes. Another possible source is the Acrobat Quick Start which pre-loads part of Acrobat into memory.

In searching for this thread, I had tried "reload", "load", and "cache" with no success. Finally "update" worked. So I'll add those terms here in case that helps someone else.

Thanks again,
August