Copy link to clipboard
Copied
I want to run an Adobe Action, on a network folder where copiers save scanned files, to remove PDF/A from files that will have it. I know the files will all begin with "PDF" due to the HP scanner software naming convention. I don't want to run on all files since there are scanned files from multiple machines and only the HP gives us PDF/A. It wouldn't be a big deal to run on all, but the action changes the date file was modified, so it makes all the files appear to have be scanned at the same time, which is confusing when people are used to finding a file by the time it was scanned. I think javascript is the way to go for this, but I may be way off. I'm new.
Acrobat Pro 10. Win 7.
You can do it if you save the file using JS. Use this code:
if (/^PDF/.test(this.documentFileName)) this.saveAs(this.path);
Make sure not to add a separate Save command, of course.
Copy link to clipboard
Copied
You can do it if you save the file using JS. Use this code:
if (/^PDF/.test(this.documentFileName)) this.saveAs(this.path);
Make sure not to add a separate Save command, of course.
Copy link to clipboard
Copied
Hmmm.
I removed the save command from the action and added the code as written
(cut & paste) but now no files are updated. Do I need to change the code to
specify where to save? Thank you for your assistance - it's much
appreciated.
Copy link to clipboard
Copied
No, it should work as is... Are you sure your files actually begin with "PDF" (in upper-case)?
Copy link to clipboard
Copied
Yes. As an example, one file is PDF0024-01.pdf
Copy link to clipboard
Copied
Are there any error messages in the console?
Copy link to clipboard
Copied
No, it runs fine, I can see the action performing on all files in the
folder - I see the file names stream by.
Only thing I can think is maybe the script is not saving the files to the
network folder where they were opened from?
Copy link to clipboard
Copied
Temp files were being created
at D:\Users\myprofilename\AppData\Local\Temp\Preflight Acrobat 10\Batch
A temp folder would be created, with a sub-folder for each PDF that action
was ran on. I was able to copy and past the folders when script running -
otherwise, at end of script, they were gone. That's probably just the
preflight itself creating those files - still not sure if/where the final
copies are saved to.
Searching for the file, PDF0024-01.pdf I don't see anywhere other than my
recent files and original network folder.
On Tue, May 24, 2016 at 5:57 PM, Peter Moses <peterrabbittask@gmail.com>
Copy link to clipboard
Copied
Are the files you're processing PDF files, or another format?
On Wed, May 25, 2016 at 1:20 AM, TheOneWhoKnocks1 <forums_noreply@adobe.com>
Copy link to clipboard
Copied
Only PDFs. In the Action wizard, I deselected all other file types so it
would run faster. I even tried renaming one of the files to "PDF.pdf" to
see if that would work but still no modified file saved in the shared drive
after running.
Copy link to clipboard
Copied
I got it, thanks so much for your help.
if (/^PDF/.test(this.documentFileName))
this.saveAs("/d/users/myprofile/desktop/adobe/"+ this.documentFileName);
Now I'm trying to figure out the inverse - the action causes the preflight
to running on all PDFs in the folder, but it only saving the ones that
begin with PDF. It would be faster if it did not preflight the other files
and skipped over them. I figure I can put some code before the preflight
action to return to top of java code if file doesn't start with "PDF".
On Wed, May 25, 2016 at 3:08 PM, Peter Moses <peterrabbittask@gmail.com>
Copy link to clipboard
Copied
Change
if (/^PDF/.test(this.documentFileName))
To
if (/^PDF/.test(this.documentFileName)==false)
On May 26, 2016 4:26 AM, "TheOneWhoKnocks1" <forums_noreply@adobe.com>
Find more inspiration, events, and resources on the new Adobe Community
Explore Now