In this article I will use both techniques to save files in different sizes, after applying some actions on them.
Adobe has developed a tool to help us with the creation of the javascript: The ‘Scripting Listener’