Copy link to clipboard
Copied
I am trying to build an Action Wizard but, what I am trying to do might be solved by a Jave Script.
I have a bunch of files with names like LUM08900361.pdf and another file with two pages named LUM08900361_GIS.pdf. I would like to be able to combine these two files. The LUM08900361_GIS.pdf will be the last two pages in the LUM08900361.pdf file.
The problem I have and cannot figure out how to do is, I have to do this same step for 170 files.
So the files that go together would be like:
LUM08900361.pdf <-- Insert at end LUM08900361_GIS.pdf and save and overwrite the first file LUM08900361.pdf after insertion. then move to the next file.
LUM08900362.pdf <-- Insert at end LUM08900362_GIS.pdf and save and overwrite the first file LUM08900362.pdf after insertion. then move to the next file.
LUM08900363.pdf <-- Insert at end LUM08900363_GIS.pdf and save and overwrite the first file LUM08900363.pdf after insertion. then move to the next file.
etc.... for a total of 170 files.
Also, the _GIS.pdf files will be stored in a different directory from the original file.
My directory structure is setup like this:
C:\GIS\Reports\LUM08900361.pdf
C:\GIS\GIS Files\LUM08900361_GIS.pdf
The action Wizard seems to me to be the best choise because it will let me choose the whole folder of files. If this works with a Java Scipt I would also be happy.
I have included files to work with.
Thanks
Copy link to clipboard
Copied
Is the relation between the two file names that the second file is always the same as the first one, just with "_GIS" added to the end of it?
Copy link to clipboard
Copied
Yes that is correct.
Copy link to clipboard
Copied
If the answer to try67's question is Yes, then you could write an "Action" script to merge the PDFs.
Copy link to clipboard
Copied
I would also like to do what the OP is suggesting. I am looking at writing a script using
this.insertPages({nPage:0, cPath:"InsertExampleSource.pdf"});
but I'm a bit stuck as to how one might vary the value of cPath for each instance of the batch process. In other words, use "LUM08900361_GIS.pdf" when processing the file "LUM08900361.pdf". Can a variable be defined for the cPath? Sorry, I'm really new to scripting.
Copy link to clipboard
Copied
Yes, you can, like this:
this.insertPages({nPage:0, cPath: this.path.replace(".pdf", "_GIS.pdf")});
And if the other files are located in a different folder (as mentioned in the original question), then you can use something like this:
this.insertPages({nPage:0, cPath: "/C/GIS/GIS Files/" + this.documentFileName.replace(".pdf", "_GIS.pdf")});