How to set autofade + interpolation + oversample _after_ sample has finished recording?

Hi, I’m trying to set up my samples so that autofade, interpolation and oversample are set after a sample has been recorded.

But when I try to just do this:

renoise.tool():add_menu_entry{name = "--Sample Editor:Paketti:Start Sampling (Record)", invoke=function() sample_and_to_sample_editor()
renoise.app().window.sample_record_dialog_is_visible=true 

  renoise.song().instruments[renoise.song().selected_instrument_index].samples[renoise.song().selected_sample_index].autofade=true
  renoise.song().instruments[renoise.song().selected_instrument_index].samples[renoise.song().selected_sample_index].interpolation_mode=4
  renoise.song().instruments[renoise.song().selected_instrument_index].samples[renoise.song().selected_sample_index].oversample_enabled=true

it says:

*** ./recorder.lua:82: attempt to index field '?' (a nil value)
*** stack traceback:
***   ./recorder.lua:82: in function <./recorder.lua:79>

so, what should i do, can i set some sort of a “create notifier before starting sampling, use notifier to set sample preferences, delete notifier” mess?

and how complex would it be?