Question on getting info to clipboard from a called command
Posted: 25 Sep 2013 19:32
Hi,
Background:
I currently use subversion, and I'd like to be able to copy one of my current workfiles to a file that includes the latest revision of that file in the name.
To get the information, I can just run
svn list -v "workfile.src"
and it'll return a line like:
1023 user 763342 Sep 18 10:20 workfile.src
And I wanted to copy workfile.src to (using the above example) workfile-v1023.src.
So, I figured I could do this with scripting. My first attempt looked like this:
This worked sometimes, and other times it would leave $myver as an empty string, leaving me with a file "workfile-v.src" (not desired)
Then I realized I should be able to do this without the batch file, so I tried this:
Unfortunately, it still didn't work.
I'm not sure what I'm doing wrong, but I'm sure it's a simple fix. I just can't see it.
Help, please!
Background:
I currently use subversion, and I'd like to be able to copy one of my current workfiles to a file that includes the latest revision of that file in the name.
To get the information, I can just run
svn list -v "workfile.src"
and it'll return a line like:
1023 user 763342 Sep 18 10:20 workfile.src
And I wanted to copy workfile.src to (using the above example) workfile-v1023.src.
So, I figured I could do this with scripting. My first attempt looked like this:
Code: Select all
writefile("c:\bin\curver.bat", "svn list -v ""<curname>""|clip");
run """cmd.exe"" /c ""c:\bin\curver.bat""", , 2, 0;
delete 0, 0, "c:\bin\curver.bat";
$mystr = <clipboard>;
$mystr = trim($mystr);
$myver = gettoken($mystr);
copyas "*-v".$myver.".?";Then I realized I should be able to do this without the batch file, so I tried this:
Code: Select all
run """d:\Program Files\TortoiseSVN\bin\svn"" list -v <curname>|clip", , 2, 0);
$mystr = <clipboard>;
$mystr = trim($mystr);
$myver = gettoken($mystr);
copyas "*-v".$myver.".?";I'm not sure what I'm doing wrong, but I'm sure it's a simple fix. I just can't see it.
Help, please!