how to checking If texture is in use in hierarchy

Hi guys i am writing a editor script for discarding unused textures from the project folder Or save unused textures to another folder

so My question is that is their a way to check that a particular texture is in use in with objects in hierarchy

i hope i made my self clear

so far i achieve this wid my code newbie coding skills

using UnityEngine;
using System.Collections;
using System.IO;
using UnityEditor;
using System.Collections.Generic;




public class Texture_finder : EditorWindow {
	
		List<Texture2D> textureList = new List<Texture2D>();
	
	 [MenuItem("Window/Texture Test")]	
	
	
	
    public static void ShowWindow()
    {
		EditorWindow.GetWindow(typeof(Texture_finder));
		
    }

	
	void OnInspectorUpdate() {
       
        Repaint();
    }
	
	
	
	//-----------------------------------------------------------
	Texture2D[] AllTexture;
	Object mObject;
	string path;
	string extention = "meta";
	 GameObject[] gameObjs ;
	string TextureName ;
	object[] allObjects;
	 
	
	
	void Start()
	{
		 
		 
	}

	
	void OnGUI()
	{
//****************************************************************
		GUILayout.BeginHorizontal ("box");
		GUILayout.Label("Texture Finder");
        if (GUILayout.Button("Find Texture "))
        {
            Find_text();
        }
		 GUILayout.EndHorizontal ();
		
		
		GUILayout.BeginHorizontal ("box");
		  mObject = EditorGUILayout.ObjectField( " drop Texture:", mObject, typeof(Texture2D), true ); 
		 
	
        GUILayout.EndHorizontal ();
//****************************************************************
	}
	
	void Find_text()
	{
		allObjects = FindObjectsOfTypeAll(typeof(GameObject)) ;
//	Debug.Log(allObjects.Length);
		
		
		
		path = "Assets/Textures";
			
		DirectoryInfo dir = new DirectoryInfo(path);
		FileInfo[] info=dir.GetFiles("*.*");
		
		for(int i=0; i<info.Length;i++)
		{
			if(!info*.Name.Contains(".meta") )*
  •  	{*
    
  •  	      foreach(GameObject Obj in allObjects)*
    
  •  	    {   Debug.Log (Obj);*
    
  •  			if(Obj.renderer)*
    
  •  			{*
    
  •  			TextureName = Obj.renderer.sharedMaterial.mainTexture.name;*
    

Debug.Log (TextureName);

_ if( TextureName == info*.Name) _
_
{_
_ Debug.Log (info.Name);
}
}
}
}
}*_

* foreach(FileInfo f in info)*
* {*
// Debug.Log(f.Name);
* }*

* }*
}

Any help would be appreciated
Thanks
AR

http://forum.unity3d.com/threads/132008-Resource-Checker-(FREE)-List-Texture-Material-Mesh-Memory-use-in-scenend

found the solution off all my problem thanks to me of course
thanks