Combine images into PDF using Automator

A novice, I am trying to write a handler combining image files into one PDF. The handler needs three inputs:

  1. the sorted list of the image files
  2. the folder where to save the output PDF
  3. the file name of the output PDF

I have tried four different approaches scripting:

  1. the GUI of “Preview”
  2. a UNIX application
  3. Adobe Acrobat Pro X
    4) Automator

In order to stay focused, I discuss each approach in a different post.

Automator actions 202 (“Get specified Finder items”) and 236 (“NewPDFfromImages”) make a workflow that could probably do what I need. However when I script

tell application "Automator"
	make new workflow
	add action 202 to workflow 1
	add action 236 to workflow 1
end tell

I cannot get rid of the screen “Choose a type for your document”.

Furthermore, even when I bypass this problem by calling a saved workflow, I still do not know how to pass on to it from within a script:

  1. the files to process (the_files)
  2. the folder where to store the output PDF (the_folder)
  3. the name of the the output pdf (the_name)

My questions are:

  • how does one address bypass the “Choose a type for your document” prompt when making a new workflow?
  • when needing a small workflow, is the best practice to build it afresh as needed or always to call a saved one?
  • how do I pass on variables from a script to a workflow?

Thanks in advance. W.