Is is possible to use auto copy/paste? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Divvy
Posts: 25
Joined: 20 Jul 2018, 03:18

Is is possible to use auto copy/paste?

20 Jul 2018, 03:36

Hello guys,

I'm a new member here and a newbie using hotkeys.

I have some work to do that involves a lot of copy/paste texts.
I'm looking for a faster way to do this, and I was thinking of using hotkeys, but I don't know if is possible.

Let me try to explain what I need:

I have a website where I need to put "domain" in field1 and "domain url" on field2.
My idea is when I copy a domain and paste into field1, the field2 will be filled automatically with that specific domain.

Please check this screenshot for better understanding: http://take.ms/ESazK

I have a long list in notepad with:
domain URL

And every time I need to copy a domain, I need to go back to the file and copy the URL too.
If someone helps me with this, is one less step that makes me save some time.

Thank you!

And sorry for my poor English, is not my native language.
Divvy
Posts: 25
Joined: 20 Jul 2018, 03:18

Re: Is is possible to use auto copy/paste?

21 Jul 2018, 08:53

Hello again guys,

Let's say I have a notepad file with the following list format:

#

21domain.com http://21domain.com

A

artdomain.com https://artdomain
animaldomain.com http://animaldomain.com

B

(...)


I want to put domain.com in field1 and url in field2.

Is it possible to just copy (Ctrl+C) the full line, example:
animaldomain.com http://animaldomain.com


And when I paste (Ctrl+V) in field1, the script put the domain in field1, give TAB and put the url in field2?

A guy from reddit gave me this code:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



But is not working like I need. But maybe someone can help me in adjust the code to my needs.

Can someone please help me?

Or if you think in a better/faster solution for my case, I really appreciate it :)

Thank you!!
GEV
Posts: 689
Joined: 25 Feb 2014, 00:50

Re: Is is possible to use auto copy/paste?

21 Jul 2018, 13:54

Try

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Divvy
Posts: 25
Joined: 20 Jul 2018, 03:18

Re: Is is possible to use auto copy/paste?

21 Jul 2018, 14:06

Hey GEV, thank you so much for helping me! :)

Unfortunately, the script is not working, nothing happens.
Btw, I changed F1 with F8 because the F1 was opening the Microsoft support page.

I tried:

1- cursor in line I wanted on notepad and clicked F8 (without select all line)
2- cursor in line I wanted on notepad, select all line and clicked F8.
3- In browser I clicked F8 again but nothing happens.

Any idea of what could be?

Thank you again for your time helping me.
GEV
Posts: 689
Joined: 25 Feb 2014, 00:50

Re: Is is possible to use auto copy/paste?

21 Jul 2018, 14:12

Have you replaced "WinTitle of Notepad" and "WinTitle of the web page" with the right titles of the programs (as shown in Windows Spy)?
Divvy
Posts: 25
Joined: 20 Jul 2018, 03:18

Re: Is is possible to use auto copy/paste?

21 Jul 2018, 16:34

GEV wrote:Have you replaced "WinTitle of Notepad" and "WinTitle of the web page" with the right titles of the programs (as shown in Windows Spy)?


Ohhh, like I said, I'm a total newbie hehe.

Thanks, it was that. But the copy is not working, is always keep saying "No text selected. Try again!"

What could be? Did you test it?

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



Thanks once again!
GEV
Posts: 689
Joined: 25 Feb 2014, 00:50

Re: Is is possible to use auto copy/paste?

21 Jul 2018, 17:12

First of all you have to activate the window to which you want send the commands, and second, the keyboard caret has to be positioned (e,g. by clicking) on the line you will copy, before pressing F8 in Notepad and
in the field1, before pressing F8 in Chrome.
Divvy
Posts: 25
Joined: 20 Jul 2018, 03:18

Re: Is is possible to use auto copy/paste?

21 Jul 2018, 18:33

GEV wrote:First of all you have to activate the window to which you want send the commands, and second, the keyboard caret has to be positioned (e,g. by clicking) on the line you will copy, before pressing F8 in Notepad and
in the field1, before pressing F8 in Chrome.


I already did that as you can see in the code above, I added the correct window titles:

Code: [Select all] [Download] GeSHi © Codebox Plus

#IfWinActive WinTitle of Notepad	
#IfWinActive Edit Model ‹ Agency — WordPress - Google Chrome


And I also did what you said too, I click on the line on notepad and only after I press F8. The error appears when I do that.
Can you try the code in your computer, please? :)

Thank you!
GEV
Posts: 689
Joined: 25 Feb 2014, 00:50

Re: Is is possible to use auto copy/paste?

22 Jul 2018, 03:27

Works for me.

Another (more practical) way is to use a GUI for sending the text:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Last edited by GEV on 22 Jul 2018, 03:56, edited 1 time in total.
Divvy
Posts: 25
Joined: 20 Jul 2018, 03:18

Re: Is is possible to use auto copy/paste?

22 Jul 2018, 03:52

That's weird, the 1st code is not working for me and I think I'm doing everything correctly.

The 2nd option is a much better option, thank you so much my friend!

But when I press send, is not sending the domain name.

I need:

field1: domain.com (selected)
field2: http://domain.com (selected)

And is sending as:

field1: http://domain.com (selected)
field2: http://domain5.com (last domain in list)

Screenshot: http://take.ms/WZGOTm

Any idea how to fix this? :)

Thank you so much for your time helping me with this.

We are very close!!
GEV
Posts: 689
Joined: 25 Feb 2014, 00:50

Re: Is is possible to use auto copy/paste?

22 Jul 2018, 04:19

I made a typing mistake. Try my edited answer.
Instead of clicking Send, you can also doubleclick the desired item or press Enter after selecting it.
To select an item you can also use the Up/down buttons on your keyboard.
Divvy
Posts: 25
Joined: 20 Jul 2018, 03:18

Re: Is is possible to use auto copy/paste?

22 Jul 2018, 04:34

Working perfectly now, thank you so much!! :D

Just two "little" things:

1- In my list, I have subsites listed in this format:

domain.com http://domain.com
- subdomain1.com http://subdomain1.com
- subdomain2.com http://subdomain2.com
- subdomain3.com http://subdomain3.com

Is it possible to ignore the "-"?
But I need to identify in the window that is a subdomain somehow.
Maybe show as "- subdomain.com" but paste as "subdomain.com"

2- Is it possible to show notes for each link in the 3rd column of the window? Example:

domain.com http://domain.com
- subdomain1.com http://subdomain1.com
- subdomain2.com http://subdomain2.com (this is a note)
- subdomain3.com http://subdomain3.com

Your code is already working great, but if you can do this, would be perfect!! :)

Thank you once again!!
GEV
Posts: 689
Joined: 25 Feb 2014, 00:50

Re: Is is possible to use auto copy/paste?  Topic is solved

22 Jul 2018, 10:31

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Divvy
Posts: 25
Joined: 20 Jul 2018, 03:18

Re: Is is possible to use auto copy/paste?

22 Jul 2018, 10:49

OMG is working perfectly !!!

Thank you so much, mate!! You're a lifesaver :D
Divvy
Posts: 25
Joined: 20 Jul 2018, 03:18

Re: Is is possible to use auto copy/paste?

22 Jul 2018, 12:09

I was thinking since I have a big list of domains, do you have any idea how to show domains per selected letter instead of loading full list?

For example, my list format:

#

21domain.com http://21domain.com

A

artdomain.com http://artdomain
- subdomainart.com http://artsubdomain.com
animaldomain.com http://animaldomain.com

B

(...)


Maybe a drop-down with the letters to choose, such as:
ALL
#
A
B
(...)


If I choose for example letter A, will only show:
artdomain.com http://artdomain
- subdomainart.com http://artsubdomain.com
animaldomain.com http://animaldomain.com


I hope you got the idea... is it difficult to create? :)

Thank you so much for your time!!
GEV
Posts: 689
Joined: 25 Feb 2014, 00:50

Re: Is is possible to use auto copy/paste?

22 Jul 2018, 15:41

Press Alt+Shift+letter to show the corresponding domain in the GUI:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Last edited by GEV on 22 Jul 2018, 17:03, edited 1 time in total.
Divvy
Posts: 25
Joined: 20 Jul 2018, 03:18

Re: Is is possible to use auto copy/paste?

22 Jul 2018, 16:31

Thank you so much :)

But is giving me an error when I run it:

Script lines most recently executed (oldest first). Press [F5] to refresh. The seconds elapsed between a line and the one after it is in parentheses to the right (if not 0). The bottommost line's elapsed time is the number of seconds since it executed.

---- C:\Users\bestl\Desktop\test.ahk
001: WinTitle := "Edit Model ‹ Agency — WordPress - Google Chrome:"
003: Hotkey,!+#,Create_LV_Key,On
004: Loop,26
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
005: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
006: Return (5.22)

Press [F5] to refresh.


Any idea how to solve it? :)

Thanks!!

P.S. Is the Alt+Shift works for numbers too?
Last edited by Divvy on 22 Jul 2018, 17:14, edited 1 time in total.
GEV
Posts: 689
Joined: 25 Feb 2014, 00:50

Re: Is is possible to use auto copy/paste?

22 Jul 2018, 17:05

Try my last edided answer.
Divvy
Posts: 25
Joined: 20 Jul 2018, 03:18

Re: Is is possible to use auto copy/paste?

22 Jul 2018, 17:14

Same error, but this time have more error lines:

Script lines most recently executed (oldest first). Press [F5] to refresh. The seconds elapsed between a line and the one after it is in parentheses to the right (if not 0). The bottommost line's elapsed time is the number of seconds since it executed.

---- C:\Users\bestl\Desktop\test.ahk
003: SetWorkingDir,%A_ScriptDir%
005: WinTitle := "Edit Model ‹ Agency — WordPress - Google Chrome:"
007: Keys := ["#","1","2","3","4","5","6","7","8","9","0"]
008: For each,key in Keys
009: Hotkey,!+%key%,Create_LV_Key,On
009: Hotkey,!+%key%,Create_LV_Key,On
009: Hotkey,!+%key%,Create_LV_Key,On
009: Hotkey,!+%key%,Create_LV_Key,On (0.03)
009: Hotkey,!+%key%,Create_LV_Key,On
009: Hotkey,!+%key%,Create_LV_Key,On
009: Hotkey,!+%key%,Create_LV_Key,On
009: Hotkey,!+%key%,Create_LV_Key,On
009: Hotkey,!+%key%,Create_LV_Key,On
009: Hotkey,!+%key%,Create_LV_Key,On
009: Hotkey,!+%key%,Create_LV_Key,On
011: Loop,26
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
012: Hotkey,"!+" Chr(A_Index + 64),Create_LV_Key,On
013: Return (2.28)

Press [F5] to refresh.
GEV
Posts: 689
Joined: 25 Feb 2014, 00:50

Re: Is is possible to use auto copy/paste?

22 Jul 2018, 17:35

On my system it°s working:
Win10 Build 17134.167 EN 64Bit
AutoHotkey_1.1.29.01 64Bit

Maybe someone else knows of a better way.

Return to “Ask For Help”

Who is online

Users browsing this forum: comvox, DarkACB, TAC109 and 52 guests