And finally I made it…
Here is a workflow that takes a filename and a directory, and assuming the file is a PDF, it extracts a set of jpgs, renames them sequentially (1.jpg, 2.jpg….) and stores the generated images in the given directory. If the directory does not exits, it gets created (provided that at least its path exists…). At the end of the process it creates an empty file called end.txt in the directory (the presence of the file can be used to veryfy that the process successfully ended).
The command line is as follows:
automator -D File="/Users/ronchet/Dropbox/ImgExtractor/Archive/Slides_Sources/08-complex.pdf" -D Dir="/Users/ronchet/_LODE/TMP" /Users/ronchet/Dropbox/ImgExtractor/ImgExtractor5.workflow
and the workflow is the following: