I would like to have a following flow:
1. high-res (HR) PDF comes in
2. if the HR PDF file size is under certain value (e.g. 500KB), move in straight into low-res (LR) output with possible renaming (this I have done)
3. if the HR is above the limit, then run a Pitstop action to make it a 100ppi low-res
4. if the LR size is now under the limit, then move it to low-res output
5. if the LR size is still above the limit, run a 72 ppi Pitstop action on the original HR file to create a smaller LR file
6. check LR size again and move to output if small enough
7. if the LR size is still above the limit, run a 40 ppi Pitstop action on the original HR file...
So is it possible to run a pitstop action with a file, check the output file's size and if it's too big, run another action with the original file. To get good quality low-res files you obviously cannot run several downsampling actions with the same low-res file, but you should use the high-res one.
I think it should be possible to write a script where the HR is copied to a temp location and then run these pitstop actions with size checks in between, but I'm not sure how to tackle this... Can you access pitstop actions through scripting? Do you have any ideas that could help me? Or just a plain "no it won't work"?

Best regards,
--patrik