Help with Creating a Multipage Scanner

Would appreciate any advice or recommendations.

I have taken shortcuts made by others and tweaked them in an attempt to create a personal scanner using ToolBox Pro’s SCAN DOCUMENT action and the Shortcuts App.

The toolbox Pro ACTION works fine if you only need to scan one or two pages. Scanning 3 or more pages fails unless you add an “OPEN URL when done” path. However, clearly I’m doing something wrong because whenever I attempt to scan 3 or more pages, this URL effectively puts me in a repeating do-loop. Sometimes it works. Other times it asks me to take the pictures again.

Attached is my shortcut. You’ll see, I’m attempting to add dates and names to the scanned files. There is WAY more in this shortcut than needed to answer this question. Figured I’d upload my full shortcut in case it helps with troubleshooting.

Appreciate any feedback, or if you have a shortcut scanner for multiple pages, and you’re willing to share, that works also.