Scripting the encoder details is pretty much impossible in iTunes. The way I do it is to put a display dialog at the beginning of the script as a reminder to double check that the importing and conversion preferences are set to what I want for the particular process I am performing before the script begins.
You should be able to set up iTunes to do this automatically, requiring no scripting whatsover. Go to the Advanced tab in your iTunes preferences and click the center menu item entitled Importing. You can choose whatever you want for what to do with the CD insertion, the encoder and the encoding quality, and then click OK.
Your only problem, of course, is that the settings have now been changed. If you need another group of settings then next time you pull up iTunes, you will have to re-set all the preferences again.
It may be possible to generate a second itunes.plist file for each set of parameters, and have a script that switches the two back and forth, but I have never tried that. I also suppose GUI scripting would be possible, but I have not done much of that either.
Have you thought either to script QuickTime directly, or to script another program to import the files, then script iTunes to pull the files into the library? this way, you’re not messing with the settings, and you may be able to get a finer control on the data you are importing.
can anybody recomend a piece of software that i could use to do the converting to aiff that would be sciptable either directly from apple script or using the comand line?