here ya go cleaner solution
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Edit 0x54231044 0x200 16 8 188 96 ""
;4 Button 0x54032000 0x0 108 116 48 14 "TRANSFER"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""
str controls = "3"
str e3
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
;when a dialog closes using ok button or DT_Ok function it returns control values that can be used for other actions
if(!empty(e3))
,out e3 ;;remove this line just to show you control text
,;;;Method1;;
,e3.setclip
,key AT ;; Alt+Tab
,0.2
,key Cv ;; Ctrl+V
,;;;Method2;;
,;paste e3;; uncomment to use this method and comment lines 17-20
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,_s.getwintext(id(3 hDlg))
,sub.OnCancelled(_s)
,case 4 ;;TRANSFER
,DT_Ok hDlg
ret 1
;
#sub OnCancelled
function ~text
if(!empty(text))
,text.setclip
,out text;;remove this line Its just for showing clipboard has been set