Author Topic: Insert/Append Script for inserting one page over and over  (Read 664 times)

0 Members and 1 Guest are viewing this topic.

nightslayer23

  • Newbie
  • *
  • Posts: 90
Insert Append tool allows for inserting a pdf document to the start or end of any pdf file, but what about if it added it to every page of one zip file.

essentially creating a "back.pdf" pdf to be added as every even or odd.

"fronts file.pdf" + "back.pdf" every even page:

Result: New.pdf > front,back,front,back end

RTT

  • Administrator
  • *****
  • Posts: 886
Re: Insert/Append Script for inserting one page over and over
« Reply #1 on: June 24, 2021, 03:13:39 PM »
"zip file" ?
If any of these PDFs have more than one page, show me an example with page indexes, so I can better understand the goal.

nightslayer23

  • Newbie
  • *
  • Posts: 90
Re: Insert/Append Script for inserting one page over and over
« Reply #2 on: June 26, 2021, 05:29:50 AM »
Apologies - i meant pdf file. Unsure what happened there :Z

Perhaps two scenarios..

The page to insert will always be a single page, to be added in as the even (or back page) to the original file.

Second scenario: both files will be the same page count, eg 36 Fronts.pdf 36 backs.pdf, and they'd be combined as Odds (fronts) Evens (backs) > output.pdf

If for instance one file was a different count to the other, blank pages could be added?

The first scenario is the main application though. it basically works in the opposite to the current Insert/Append function, whereby instead of in the box "pages to include" being able to enter "odd" "even" "all" etc, the insert/append info section allows for the original file to say "after each page"

RTT

  • Administrator
  • *****
  • Posts: 886
Re: Insert/Append Script for inserting one page over and over
« Reply #3 on: June 28, 2021, 02:37:34 PM »
The page to insert will always be a single page, to be added in as the even (or back page) to the original file.
I'm going to change the insert/append pages tool to accept multiple insert indexes (current "insert point page" column), with support to index expressions (odd, even, Xn, etc.). This way it will be possible to do multiple inserts withing one run.

Quote
Second scenario: both files will be the same page count, eg 36 Fronts.pdf 36 backs.pdf, and they'd be combined as Odds (fronts) Evens (backs) > output.pdf
This interleave functionality is already possible with the merge tool. Just set for merging the fronts and backs PDFs and check the "merging sequencing through documents in the list" option. You can use the copies column to set the "back" pages to match the number of pages of the fronts one.

nightslayer23

  • Newbie
  • *
  • Posts: 90
Re: Insert/Append Script for inserting one page over and over
« Reply #4 on: June 29, 2021, 01:11:27 PM »
GREAT! next update I assume?

also, is there a way of creating shortcut commands for tasks?

RTT

  • Administrator
  • *****
  • Posts: 886
Re: Insert/Append Script for inserting one page over and over
« Reply #5 on: June 30, 2021, 05:43:15 PM »
next update I assume?
Probably.

Quote
is there a way of creating shortcut commands for tasks?
Windows global shortcut? What tasks? Please give me more details about what you are referring to.

nightslayer23

  • Newbie
  • *
  • Posts: 90
Re: Insert/Append Script for inserting one page over and over
« Reply #6 on: July 01, 2021, 07:22:51 AM »
next update I assume?
Probably.

Quote
is there a way of creating shortcut commands for tasks?
Windows global shortcut? What tasks? Please give me more details about what you are referring to.

for scripts and options from your menu

RTT

  • Administrator
  • *****
  • Posts: 886
Re: Insert/Append Script for inserting one page over and over
« Reply #7 on: July 05, 2021, 03:35:16 PM »
I don't think Windows has a way to add custom shortcuts to File Explorer, or to shell context menu items.
But using the PDF-ShellTools command line interface, and some Windows tricks, this is doable.

  • Extract the attached .js script to a work folder.
  • Open it in a text editor and check if the path to the PDFShellTools.exe is pointing to where you have it on your system. Change accordingly.
  • Create a shortcut to CallShellTools.js, i.e. right click the CallShellTools.js file and execute the "create shortcut" option.
  • Cut the created shortcut and paste it in a Start Menu folder (How to Open the Start Menu Folder), e.g. in the PDF-ShelTools program group folder, C:\ProgramData\Microsoft\Windows\Start Menu\Programs\PDF-ShellTools.
  • Open the shortcut properties dialog and edit the "shortcut key" to enter the shortcut you want to use, and add the command line arguments to the "Target" field.
Examples:
To call the Merge tool, add Merge to the target field
To call a script named "Print Arguments", add RunScript "ScriptName=Print Arguments" to the target field.

Now you just need to select, in the Windows File Explorer, the PDF files you want to process, and press the keyboard shortcut you assigned.

You can repeat the process to create shortcuts to all the other tasks you use often.