Variable Probleme

Hi,
ich bin gerade dran mein Programm zu verbessern, indem ich mehr Codecs ein baue jedoch öffnet sich keine Variable, wenn ich auf den Button klicke.
Hier mein Code:

on clicked theObject
set a to display dialog {“MP3”, “Apple Lossless”, “AAC”, “AIFF”}

if the answer is "MP3" then
	tell application "iTunes"
		set current encoder to encoder "MP3 Encoder"
		convert playlist "convertlist"
	end tell
end if
if the answer is "Apple Lossless" then
	tell application "iTunes"
		set current encoder to encoder "Apple Lossless Encoder"
		convert playlist "convertlist"
	end tell
end if
if the answer is "AAC" then
	tell application "iTunes"
		set current encoder to encoder "AAC Encoder"
		convert playlist "convertlist"
	end tell
end if
if the answer is "AIFF" then
	tell application "iTunes"
		set current encoder to encoder "AIFF Encoder"
		convert playlist "convertlist"
	end tell
end if

end clicked

Habs:

on clicked theObject
set a to choose from list {“MP3”, “Apple Lossless”, “AAC”, “AIFF”}

if the answer is “MP3” then
tell application “iTunes”
set current encoder to encoder “MP3 Encoder”
convert playlist “convertlist”
end tell
end if
if the answer is “Apple Lossless” then
tell application “iTunes”
set current encoder to encoder “Apple Lossless Encoder”
convert playlist “convertlist”
end tell
end if
if the answer is “AAC” then
tell application “iTunes”
set current encoder to encoder “AAC Encoder”
convert playlist “convertlist”
end tell
end if
if the answer is “AIFF” then
tell application “iTunes”
set current encoder to encoder “AIFF Encoder”
convert playlist “convertlist”
end tell
end if
end clicked

Da musste set a to choose from list, anstatt set a to display dialog hin…

Aber, nächstes Problem, wenn ich den Codec wähle, kommt Variable Answer ist not defined… Wo liegt jetzt der fehler

??? Steh ich jetzt ganz auf m schlauch, aber da steht ja set a to choose from list, ich seh da nirgendwo, dass da steht set answer to…

??

[quote=“Marduk”]??? Steh ich jetzt ganz auf m schlauch, aber da steht ja set a to choose from list, ich seh da nirgendwo, dass da steht set answer to…

??[/quote]

Vermutlich ist das nicht der Orginalcode und er hat jetzt nur so etwas dazugeschrieben und vergessen die anderen variablennamen zu ändern…