Copy & Paste Between 2 APPS

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
thebib622
Posts: 25
Joined: 01 Aug 2017, 17:09

Copy & Paste Between 2 APPS

25 Sep 2017, 16:56

I would like for someone to try and help me with a script. It would help me a lot for my classes.

I will be using to programs. Notepad and Aegisub subtitle editor

I want to have a script that will automatically send a PASTE command, in Aegisub subtitle editor after it detects I have copied text from notepad.

Thanks to anyone that can help. I am sorry to bother anyone for scripts, I just am no good at creating more than grade school level scripts without spending hours.
thebib622
Posts: 25
Joined: 01 Aug 2017, 17:09

Re: Copy & Paste Between 2 APPS

25 Sep 2017, 19:15

Code: Select all

f3::
clip_Save := ClipboardAll
Clipboard := "" ; empty
WinActivate, ahk_exe notepad++.exe
Send ^c ; copy selection
ClipWait
WinActivate, ahk_exe aegisub32.exe
send ^v ; paste
sleep 200 ; wait for the paste to be over
Clipboard := clip_Save
return
Something like this is... But I want to bypass the F3 requirement, and have it do it automatically.
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: Copy & Paste Between 2 APPS

26 Sep 2017, 00:19

Try:

Code: Select all

#Persistent

OnClipboardChange:
	if (A_EventInfo = 1) && WinActive("ahk_exe notepad++.exe") {
		ControlSend, ahk_parent, ^v, ahk_exe aegisub32.exe
	}
return
thebib622
Posts: 25
Joined: 01 Aug 2017, 17:09

Re: Copy & Paste Between 2 APPS

27 Sep 2017, 21:27

This script doesn't work consistently. It will send my clipboard to aegisub32.exe once, and then seemingly stops working after that...
Is anyone able to make this script work every time the clipboard is changed, not just from notepad++.exe?

I am using the mouse to copy lines of text.
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: Copy & Paste Between 2 APPS

27 Sep 2017, 22:47

thebib622 wrote:Is anyone able to make this script work every time the clipboard is changed, not just from notepad++.exe?
Just remove && WinActive("ahk_exe notepad++.exe")

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: gongnl, Joey5, RandomBoy, Rohwedder and 386 guests