Running an Action with JS is not possible.
You can try to implement these commands using a Preflight profile and then
save the file using saveAs.
On Wed, Mar 4, 2015 at 12:18 PM, Andreas Jansson <firstname.lastname@example.org>
The suggestion to use preflight for optimized save has been done on a couple of questions similar to mine, but never explained in detail, so I'll just add some detail, while exploring it:
I didn't know where to find the PDFOptimizer settings for preflight in Acrobat Pro XI, but it's here:
1. Show the "Print production" pane, by checking it in the small foldout menu in the top of the right hand menu.
2. Under Print production click Preflight.
3. from the Options menu in the top right corner of the Preflight window, select Create new preflight profile.
4. Under "Fixups" you will find many of the Save optimized PDF options, such as Downsample images, and discard object.
Try64 answered that it could not be done. That's why I went on to explore how to save optimized using preflight.