Editor scripting, U4, updating display of Importer changes?

Editor scripting in Unity5 …

For example to get all all the selected items:

static Object[] GetSelectedAudio()
    return Selection.GetFiltered( typeof(AudioClip), SelectionMode.DeepAssets );

To change those items:

[MenuItem ("Utilities/AudioSettings/Set alladem selected to Native WAV")]
static void  __fNative()
	foreach (AudioClip ac in GetSelectedAudio())
		string path = AssetDatabase.GetAssetPath( ac );
		AudioImporter ai = AssetImporter.GetAtPath(path) as AudioImporter;
		ai.format = AudioImporterFormat.Native;
		AssetDatabase.ImportAsset( path );

This works perfectly howaver…

Select ONE audio clip – that that audio clip is now selected in the INSPECTOR - run the script.

What happens is in fact it “does change it”

#BUT the INSPECTOR does not change

It then changes it back to how it was - the Apply state becomes confused.

I’m sure Editor Scripting Experts know exactly what I mean.

Can anyone generously tell me the fix? Thanks!

I could be completely useless here but I’ll try to help…this is a simple editor script? and you are doing this in “OnInspectorGUI”, and if you are infact dealing with serialization… could the problem be that you are not using the function “ApplyModifiedProperties” at the end of “ONInspectorGUI”?