Copy and Paste Topic is solved
Copy and Paste
Hi, i need simple script that copy selected text with F6 to file on desktop mix.txt, and next time F6 add selected text at the end of that file. I try to do myself but i am new to this.
Re: Copy and Paste Topic is solved
Try this simple code:
I hope that helps.
More sophisticated is with a delimiter:
Code: Select all
; hotkey to collect selected texts in a file
;-------------------------------------------------------------------------------
F6:: FileAppend, % get_Highlight(), %A_Desktop%\mix.txt
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
get_Highlight() { ; get highlighted text
;-------------------------------------------------------------------------------
ClipStore := ClipboardAll ; remember current content
Send, ^c ; copy highlighted text
ClipWait, 1 ; wait for change
Result := Clipboard ; store highlighted text
Clipboard := ClipStore ; restore previous content
Return, Result
}
More sophisticated is with a delimiter:
Code: Select all
#NoEnv
#SingleInstance, Force
Delimiter := "`n`n"
Return ; end of auto-execute section
; hotkey to collect selected texts in a file
;-------------------------------------------------------------------------------
F6:: FileAppend, % get_Highlight() Delimiter, %A_Desktop%\mix.txt
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
get_Highlight() { ; get highlighted text
;-------------------------------------------------------------------------------
ClipStore := ClipboardAll ; remember current content
Send, ^c ; copy highlighted text
ClipWait, 1 ; wait for change
Result := Clipboard ; store highlighted text
Clipboard := ClipStore ; restore previous content
Return, Result
}
Re: Copy and Paste
Work great, thank you very much:)
Who is online
Users browsing this forum: Araphen and 413 guests