I have a small and simple code which works fine. It ...
1) checks if UltraEdit is active
2) if yes, copy the current selection to clipboard
3) check if AutoCAD exits
4) if yes, jump to AutoCAD and paste the clipboard into in
Here is the code:
Code: Select all
; Belegung der Taste "Ctrl+ü".
; Codetest: Markierten Text in Zwischenablage, im AutoCAD Textfenster einfügen und mit Enter auslösen
^ü::
SetTitleMatchMode, 2
IfWinActive, UltraEdit 64-bit
{
SetTitleMatchMode, 1
AutoTrim Off ; Retain any leading and trailing whitespace on the clipboard.
Clipboard = ; Must start off blank for detection to work.
Send ^c
ClipWait 1
ifWinExist, AutoCAD-Textfenster
WinActivate, AutoCAD-Textfenster
Else
{
WinActivate, Autodesk AutoCAD
Send (textscr){enter}
Sleep, 100
; msgbox "Fenster fehlt"
; Return
}
ifWinExist, AutoCAD-Textfenster
{
Send ^V
sleep, 100
send {enter}
}
}
else
TrayTip , clip2acad.ahk, Aufruf vom falschen Programm, 1, 33
return
Now I want to a simple, last step:
5) Jump back to UltraEdit
I tried something with WinActivate and so on, but nothing happens. The cursor keeps active in AutoCAD. What's wrong?
Peter