2
you have an idea of how to automate the following situation?
I’m using Autohotkey for this.
I will tell you the situation and then I will tell you the hypotheses I considered (part of them only, since I could not finish)
1 - I give Ctrl+c in a content with several lines, I will call them 1,2,3,4,5 and 6 to facilitate logic.
I just want to copy the line 2, 3, 4 and 5 but also with selection of content in the lines, that is, not copy the whole line 2, only the numbers (delete the texts). The same goes for other lines, but with another type of filter.
2 - The script then sends pro Clipboard only the desired content of line 2, 3, 4 and 5 and then inserts in an output file only the desired content of line 2 with another default text. The same happens for the other lines.
Example: Line 2 has "XYZ123". The script copies "123" only and sends the output file "ABC123". The same occurs for other lines.
3 - The script after copying all lines, inserts a new line 7 of my choice that will exist only in the output file.
4 - The script then waits for the next CTRL+C to repeat the process with the next CTRL+C.
PS: The lines are not always in the same order. For example, the content of line 2 is sometimes on line 3. But there is always a keyword in each line that can be used to filter your content.
The next step would be to take Ctrl+c already automatically in the content, but I will stick first to resolve this impasse.
Hypotheses I’ve considered:
1 - To separate each row and paste always in the same order, use variables to assume the value of the row already with unwanted content deleted.
2 - If you can’t automate the order of the lines, it’s okay to use hotkeys to decide which line is which or a system message to ask me that and act on the answer.
clipboard = ; Começa o script com o clipboard vazio
ClipWait ; Espera encher o clipboard
FileAppend, %clipboard%`r`n, C:\Users\caio_\Desktop\Teste de programação\Saída.txt ; Joga pro arquivo de saída
MsgBox Control-C copied the following contents to the clipboard:`n`n%clipboard% ; Aparece uma confirmação do que foi copiado (vou tirar quando estiver tudo funcionando)
Reload ; Pra reabrir o script
Sleep 1000 ;
MsgBox, 4,, The script could not be reloaded. Would you like to open it for editing?
IfMsgBox, Yes, Edit
return
Edit to better explain the doubt: the problem is that I could not find a way to filter the content of the Clipboard and so I could not integrate other commands to result in my idea. The goal is to find a way to filter the content, which I really couldn’t find. By doing this, I can figure out how to work the rest. I described the whole situation in case someone gives a good idea of how to throw it to an output file in the best way.
The idea is quite well described, but what exactly is the doubt? If you can [Dit] post and comment on what you tried, and what problem you found, or what didn’t work, it might be easier to help. The way it is, the question is a bit wide and vague. Maybe it helps: [Tour], [Ask] and [Help].
– Bacco