convert audio then ftp converted file?

I am trying to have a drop on apple script where it converts an audio file then ftps the file and deletes the file from the playlist and the converted file when finished.

In addition trying show progress of the ftp.

i keep getting an error " A descriptor type mismatch occured" I am missing some thing in the script. Possibly passing the correct variable of the file to ftp the audio file.

//script below --------------------------------------

on open audio_file
tell application “iTunes”
set preferred_encoder to current encoder
set available_encoders to (name of encoders)
repeat with anEnc in available_encoders
if format of encoder anEnc is “AAC” then
set current encoder to encoder anEnc
exit repeat
end if
end repeat

convert audio_file
set x to alias audio_file
set current encoder to preferred_encoder

end tell

set user_name to “username”
set pass_word to “password”
set url_name to “url”
set x to new_audio

tell application “URL Access Scripting”
upload x to “ftp://” & user_name & “:” & pass_word & “@” & url_name replacing yes with progress without binhexing

end tell

end open

Thank you that worked great.

For some reason the progress doesn’t seem to work. Is there something else that needs to be done to show the progress of the ftp? This decleration is in the dictionary for the URL Access Scripting

tell application “URL Access Scripting”
upload x to fullURL replacing yes with progress without binhexing
end tell

I believe this is a known bug in OS X.

Cool, this is great.

Anyone know how to set the bitrate if I use the MP3 encoder? Does it have anything to do w/ the ‘item 1’ thing?

Thanks