How to get full path for traces in a graph

I have few traces on a graph (plotted waves are in different folders), want to do some processing while preserving the original waves. So, I want to write a function which can do the custom processing I need on the traces in the graph. For that I wanted to copy the X and Y waves on the graph to a folder named, say, "analysis". So for that (and for other purposes also in future) I wanted to get the "full path" to the traces in the graph. I am trying this since last few days but failed to figure out. I am aware of the function "WaveRefIndexed" but I can only change the wave in the trace using this, cannot use it to copy the wave. One solution is to copy the waves manually in one folder and then use the function "WaveName". But this is not an efficient method for me as I use lot of folders and traces from them on the same graph for comparison. I hope there is method to achieve this in Igor. Any help is greatly appreciated.
Hi,

I just did a quick test and I think waverefindexed should work for you.

•Make/D test //create source wave
•test =gnoise(1) //make it a bit more interesting in graph
•Display/K=0 root:test //create a graph with it
•duplicate waverefIndexed("",0,1) :analysis:fred // use waverefindexed to identify it and use it as wave reference in a duplicate function to put a copy named fred in a folder called analysis.

The point to appreciate is that the return of waverefindexed is to be used where srcWaveName must be the name of an existing wave in duplicate.

Hope this helps.

Andy