Mapkey to copy a text.
Mapkey to copy a text.
(OP)
How to create a mapkey which can copy a selected text? E.g. say I have xyz.asm as active model, Mapkey should do following tasks. File->Rename-> Copy Highlighted text(in New Name TextBox which will be "xyz")->Cancel button. File->Open->Change the type to Drawing(.drw)->paste already copied text(i.e. xyz)->Open button.
I guess this is very difficult. But I think it is possible, I'm trying with different options like using Windows batch file to copy and paste, not lucky so far. Hope to receive some of your responses.
I guess this is very difficult. But I think it is possible, I'm trying with different options like using Windows batch file to copy and paste, not lucky so far. Hope to receive some of your responses.





RE: Mapkey to copy a text.
You can also lookup Windows Script Host (WSH).
Stephen Seymour, PE
Seymour Engineering & Consulting Group
www.seymourecg.com
RE: Mapkey to copy a text.
Change the path location of bat files and workfolder in mapkey and bat file.
RE: Mapkey to copy a text.
Learned something new today,thanks Mehit!!!
RE: Mapkey to copy a text.
Even though this is not robust programming method, but works well in some cases.
This one will open the drawing of current model.
File name: OpenDrawing.vbs
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "%{TAB}", True
WshShell.SendKeys "%w"
WshShell.SendKeys "a"
WshShell.SendKeys "%f"
WshShell.SendKeys "r"
WshShell.SendKeys "^c"
WshShell.SendKeys "%{F4}"
WshShell.SendKeys "%f"
WshShell.SendKeys "O"
WshShell.SendKeys "^v"
WshShell.SendKeys ".drw"
WshShell.SendKeys "{ENTER}"
Mapkey to Run VBS file:-
mapkey(continued) @SYSTEM\@ echo off\nC:\\users\\xxx\\OpenDrawing.vbs\nexit;
RE: Mapkey to copy a text.
Keep in mind that on problem with the sendkeys method is that the focus to the program you are sending the keystrokes to can be lost. This typically happens when MS Outlook pops up a message or something. I believe there is an app activate function in VB Script you can call ( I know this funciton is in VB6 and VB.net) to help maintain the focus of the proe window.
Stephen Seymour, PE
Seymour Engineering & Consulting Group
www.seymourecg.com