iDVD magic dvd from folder containing mpg


I’d like to make a little applescript for creating a magic dvd with idvd auomatically from a folder containing my mpg files.

something like:

tell application “iDVD”
start magic iDVD theme “…” title “myDVD”
repeat with thisfile in allfiles
add movie for magic iDVD with path of thisfiles
end repeat
create magic iDVD
end tell

Thanks for your help