How to obtain selected files in the Project-window?

I’m trying to make an editorscript that detects which files are selected in the Project-window and populate them in an array or list, when creating a GameObject. I have the following code:

[MenuItem("GameObject/Custom/AudioClipShuffler")]
static void CreateAudioClipShuffler()
{    
	GameObject go = new GameObject("AudioClipShuffler");
	AudioClipShuffler audioClipShuffler = go.AddComponent<AudioClipShuffler>();

	// Get whatever is selected in the Project-window as an array or list
	// Filter down to only an array or list of AudioClips (called audioClips)

	audioClipShuffler.SetAudioClips(audioClips); //SetAudioClips takes an array or list

  	GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
  	Undo.RegisterCreatedObjectUndo(go, "Create " + go.name);
	Selection.activeObject = go;
}

(inspired by Unity - Scripting API: MenuItem)

Can anyone please help me with the two steps I’m missing? Thanks so much in advance!

Okay - found out myself :slight_smile: No big deal, really:

	List<AudioClip> audioClips = new List<AudioClip>();

	foreach (Object o in Selection.objects)
	{
		if (o.GetType() == typeof(AudioClip))
		{
			audioClips.Add((AudioClip)o);
		}
	}