I'm using the split element to split files and I'm adding "#[index]" as a suffix. This works as an inline value. However, the split element pads the index to the number of digits in the original page count of the original file. If the original file had 7 pages, then the suffix for the first file is #1. If the original file had 43 pages, then the suffix for the first file is #01. This leaves me with a bunch of files that have different length suffixes.
I want to always pad it to 3 digits. I thought I could use a script expression like this:
however I get a syntax error when I run the flow. (Why doesn't the script expression window check the syntax? Why do I have to wait until runtime?)
I tried using the "single line text with variables" but that window gives me an error at the bottom that says "[index] - unknown variable" and I can't find index in any of the variable categories.
What is the correct syntax for using [index] in a script expression?