First post here, im very new to Switch and trying to learn.
Im trying to use the number in the input filename to set the number of copies.
Sample filenames can look like these SamplePDF-50x.pdf or AnotherSample-1000x.pdf
I made a simple flow using the Quite hot impose app, and a controll xml, this seems to work ok but the number of copies is static and needs to become variabel.
Im not very proficient with coding and im strugling with the next parts:
- Extracting the number of copies from the filename --> (the number is always after a -)
- correctly using the variabel in the controll xml
I tried this in the xml file, but didnt work:
<?xml version="1.0" encoding="UTF-8" ?>
<QUITEXML xmlns="http://www.quite.com/general/ns/quitexml/">
<ITEMS>
<DICT N='0'> <ITEMS>
<A N='Category'>OneCommand_V1</A>
<A N='Command'>PageTools</A>
<DICT N='Desc'> <ITEMS>
<S N='0'>Action: Duplicate pages</S>
<S N='1'>Range: all pages</S>
<S N='2'>Copies: X</S>
<S N='3'>Collate: yes</S>
</ITEMS> </DICT>
<DICT N='Params'> <ITEMS>
<A N='Action'>DuplicatePages</A>
<B N='Collate'>1</B>
<I N='Copies'>[Job.Name:Search="SamplePDF-(\d+)x\.pdf$" Replace="$1"]</I>
<I N='PosX'>693</I>
<I N='PosY'>268</I>
<S N='Requires'>qi3alphabase[QI 3.0/QHI 3.0 alpha]</S>
<DICT N='Source'> <ITEMS>
<DICT N='Range'> <ITEMS>
<A N='RangeType'>AllDoc</A>
</ITEMS> </DICT>
</ITEMS> </DICT>
</ITEMS> </DICT>
<DICT N='Provider'> <ITEMS>
<S N='Code'>QITE_CMDLINE1</S>
<S N='FullName'>Quite Hot Imposing</S>
<S N='Name'>Quite Hot Imposing</S>
<I N='Version'>1</I>
</ITEMS> </DICT>
<I N='Version'>1</I>
</ITEMS></DICT>
<A N='Category'>CommandList_V1</A>
<B N='DoPrompt'>0</B>
<S N='Requires'>qi2base</S>
<DICT N='Stats'> <ITEMS>
<S N='Created'>D:20250211095800</S>
</ITEMS></DICT>
<A N='UIMode'>None</A>
</ITEMS>
</QUITEXML>
Can someone help me shed some light on how to do this?
Thanks!

Cheers Richard