What I am trying to do is create a little function to save myself some time. I am re-organizing my portable file structure. In my XY environment I "virtualize" everything I can; so I make use of XY variables (like <xydrive>) and substitution, i.e ?:\path\path...
My function should work like this: I copy a path to an executable to the clipboard using the function. The function takes whats in the clipboard and prunes off the drive letter and :. Then is adds a variable to the front of the string and puts the new path back to the clipboard so I can paste it where it needs to be.
So I copy "g:\portable path\some other path\someexe.exe" to the clipboard and then get "<xydrive>\portable path\some other path\someexe.exe" on the clipbpoard.
So what I am having a problem with is trying to add the variable to a copied path without it be interpolated. I have tried the single quotes, per the help file, to stop interpolation but it does not work.
Here is the current form of the function; its not as clean as I would like but I have been trying several things to get this to work.
Code: Select all
"XY Pre-Paste";
copytext <curitem>;
$x=(substr(<clipboard>, 2));
$y='<' . 'xydrive' . '>' . $x;
copytext $y;
I have tried things like $y='<xydrive>'$x and other. I am hoping that I am not missing something obvious.
I have not tried a similar function to get something like "?:\portable path\some other path\someexe.exe" as a result. So hopefully the solution to the question works for both <xydrive> and ?
Any help would be greatly appreciated.