Hi!
I'm looking for a script that can replace my "condition with variables". We receive single paged pdf's and the name of the file determine if it's a odd or even page.
I have created a "condition with variables", but I assume this can be done in a script instead. We are using PowerSwitch.
The condition with variables goes like this (even pages):
Job Name Contains 02.pdf
OR
Job Name Contains 04.pdf
OR
Job Name Contains 06.pdf
and so on...
I'm a newbie regarding scripts but are fascinated about the possibilities, and are eager to understand more Therefore it would be great if someone in this forum could help me.
Kind regards
Frode Nordeide
Sorting odd and even pages
Sorting odd and even pages
Frode,
You can for sure do this with a script, but why would you go there? I'm relatively certain you can also accomplish what you want with a simple file name filter using regular expressions and that wouldn't involve scripting at all.
I'm not an expert on writing regular expressions without trying them, but something like this:
".*[24680].pdf"
would match any filename that ends on "2.pdf", "4.pdf" and so on.
David.
frode wrote: Hi!
I'm looking for a script that can replace my "condition with variables". We receive single paged pdf's and the name of the file determine if it's a odd or even page.
I have created a "condition with variables", but I assume this can be done in a script instead. We are using PowerSwitch.
The condition with variables goes like this (even pages):
Job Name Contains 02.pdf
OR
Job Name Contains 04.pdf
OR
Job Name Contains 06.pdf
and so on...
I'm a newbie regarding scripts but are fascinated about the possibilities, and are eager to understand more Therefore it would be great if someone in this forum could help me.
Kind regards
Frode Nordeide
You can for sure do this with a script, but why would you go there? I'm relatively certain you can also accomplish what you want with a simple file name filter using regular expressions and that wouldn't involve scripting at all.
I'm not an expert on writing regular expressions without trying them, but something like this:
".*[24680].pdf"
would match any filename that ends on "2.pdf", "4.pdf" and so on.
David.
frode wrote: Hi!
I'm looking for a script that can replace my "condition with variables". We receive single paged pdf's and the name of the file determine if it's a odd or even page.
I have created a "condition with variables", but I assume this can be done in a script instead. We are using PowerSwitch.
The condition with variables goes like this (even pages):
Job Name Contains 02.pdf
OR
Job Name Contains 04.pdf
OR
Job Name Contains 06.pdf
and so on...
I'm a newbie regarding scripts but are fascinated about the possibilities, and are eager to understand more Therefore it would be great if someone in this forum could help me.
Kind regards
Frode Nordeide
Sorting odd and even pages
Hi David,
".[24680].pdf" did it, perfect!!
But that's nothing compared to the fact that your answer gave me the key to understand regular expressions, hurray!
Thanks a lot!
Frode
".[24680].pdf" did it, perfect!!
But that's nothing compared to the fact that your answer gave me the key to understand regular expressions, hurray!
Thanks a lot!
Frode
Sorting odd and even pages
My pleasure!
There are a couple of very good websites regarding regular expressions around, even including (I seem to remember) sites that let you try things out and stuff like that.
David.
There are a couple of very good websites regarding regular expressions around, even including (I seem to remember) sites that let you try things out and stuff like that.
David.