views:

230

answers:

4

Subject says it all but he background:

I want to trigger some TortoiseSVN action from a batch file? I suspect that I can do this by calling the right exe with the right args but I'd rather find a way to solve the more general problem of doing an arbitrary action.

Edit: The reason that I don't just use svn directly is that TortoiseSVN doesn't include a command line SVN client (e.i. there is no svn.exe on my computer at all). Also, it would dump it output the stdout and I want the GUI output.

Regarding the Right Click menu, besides a way to directly trigger a right click item, a way to take an arbitrary right click item and (more or less automatically) find out what command line to call would also be good enough. However a solution that amounts to "just find out what it does" is not as I already know how to go there.

I don't have any specific reason to believe this can be done, so if someone knows it can't be, that would be a valid answer as well.

A: 

Seems to me as if you answered the question yourself. To trigger an arbitrary action will still require knowing something about the action. I am not sure that you will get any benefit from triggering a right click on a menu over calling the exe with the args in the first place.

Vincent Ramdhanie
+1  A: 

Now that's somewhat redundant. =) Tortoise wraps the svn command lines and you want to automate the tortoise UI actions ...

Is there any reason you wouldn't just write a batch file that said, oh:

svn update

For help with svn, just type:

svn help

or

svn help <command>
Niniki
A: 

Provided that you know how to make the file selected, SendKeys method of WSH can be used (Alt+F) to open File menu, where all context menu items are doubled. You can use the same method to get proper item choosen.

Unfortunately, WSH cannot simulate mouse.

Dmitry Khalatov
+2  A: 

Use TortoiseProc.exe /command: See Appendix E of the TortoiseSVN guide

A good answer to my case (+1). OTOH I was really hoping for something more general.
BCS