Hi,
I frequently have to select all text lines in a document after the line which says "Conclusion:", and number those lines with bullets 1.,2.,3...
I am hoping to get a script which will select and automatically number all lines which follow the phrase "Conclusion:" when I press Capslock & Q. "Conclusion:" should not be selected or numbered.
Many thanks.
tnmc77
Selecting and numbering lines after specific word in adocument
- FanaticGuru
- Posts: 1906
- Joined: 30 Sep 2013, 22:25
Re: Selecting and numbering lines after specific word in adocument
The solution depends on the software in which you are viewing the document.
For example, the code would be very different in MS Word as opposed to Notepad.
What program are you using to view and edit?
FG
For example, the code would be very different in MS Word as opposed to Notepad.
What program are you using to view and edit?
FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
Re: Selecting and numbering lines after specific word in adocument
Voice recognition program called Powerscribe 360.
- FanaticGuru
- Posts: 1906
- Joined: 30 Sep 2013, 22:25
Re: Selecting and numbering lines after specific word in adocument
That is a piece of software that few people are going to have access to so it is unlikely that someone is going to be able to give you a completely working script that works for that software with out more information. You could get lucky though.tnmc77 wrote:Voice recognition program called Powerscribe 360.
Can you use Control+A to select the entire document and then Control+C to copy the entire document to the clipboard? If so then you might be able to use that technique to get the text into AHK through the clipboard. Then have AHK make changes to the text in the clipboard and then paste the entire changed document back from the clipboard.
FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
Re: Selecting and numbering lines after specific word in adocument
The problem is that I don't know how to come up with script even if I was using Microsoft word. Have searched but can't do it myself.
Thanks.
Thanks.
- FanaticGuru
- Posts: 1906
- Joined: 30 Sep 2013, 22:25
Re: Selecting and numbering lines after specific word in adocument
Here is an example of how it might be done in Notepad using the clipboard:tnmc77 wrote:The problem is that I don't know how to come up with script even if I was using Microsoft word. Have searched but can't do it myself.
Thanks.
Code: Select all
F12::
Send ^a^c
ClipWait
S := "", Bullets := 0
Loop, Parse, Clipboard, `n, `r
{
if Bullet
if A_LoopField
{
S .= Bullet ". " A_LoopField "`r`n"
Bullet ++
continue
}
else
Bullet := 0
S .= A_LoopField "`r`n"
if (A_LoopField = "Conclusion:")
Bullet := 1
}
Clipboard := S
Send ^v
return
This
Code: Select all
this is a test line
this is another test line
Conclusion:
one
two
three
Other stuff.
Code: Select all
this is a test line
this is another test line
Conclusion:
1. one
2. two
3. three
Other stuff.
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
Re: Selecting and numbering lines after specific word in adocument
Thank you so much. Can not wait to test. Once again, much obliged.
Re: Selecting and numbering lines after specific word in adocument
Fantastic. Really sorry for delayed feedback. Finally got a chance to try and it worked like a charm. May I bother you for a script which will only select everything after "conclusion:" instead of numbering it. Thanks.
- FanaticGuru
- Posts: 1906
- Joined: 30 Sep 2013, 22:25
Re: Selecting and numbering lines after specific word in adocument
"Selecting" text is more problematic as it requires knowledge of the software which I do not have.tnmc77 wrote:Fantastic. Really sorry for delayed feedback. Finally got a chance to try and it worked like a charm. May I bother you for a script which will only select everything after "conclusion:" instead of numbering it. Thanks.
Does the software have a "Find" command? Basically you need to figure out how this can be done in the software with just using the keyboard. For example in Notepad I could hit Control+F to active find command, then find "Conslusion:", hit "Esc" to close find command, "Right Arrow" move to next line, "Control+Shift+End" to highlight to end.
You need to find a way that the text you want could be highlighted using just keyboard keys and then you can have AHK do the same thing through keyboard keys.
Like I said originally, the solution is specific to the software.
FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
Re: Selecting and numbering lines after specific word in adocument
FanaticGuru,
I have been using the script you provided, mostly with great success. I am very thankful for that. Wanted to give you followup that the script sometimes, and as best as I can tell, randomly produces "incorrect" results. Following is the example. Any tweaks?
this is a test line
this is another test line
Conclusion:
one
two
three
is incorrectly converted to the following when I run the script.
this is a test line
this is another test line
Conclusion:1.
2. one
3. two
4. three
or
is incorrectly converted to
this is a test line
this is another test line
Conclusion:
2. one
3. two
4. three
instead of the following correct way of numbering.
this is a test line
this is another test line
Conclusion:
1. one
2. two
3. three
I have been using the script you provided, mostly with great success. I am very thankful for that. Wanted to give you followup that the script sometimes, and as best as I can tell, randomly produces "incorrect" results. Following is the example. Any tweaks?
this is a test line
this is another test line
Conclusion:
one
two
three
is incorrectly converted to the following when I run the script.
this is a test line
this is another test line
Conclusion:1.
2. one
3. two
4. three
or
is incorrectly converted to
this is a test line
this is another test line
Conclusion:
2. one
3. two
4. three
instead of the following correct way of numbering.
this is a test line
this is another test line
Conclusion:
1. one
2. two
3. three
Who is online
Users browsing this forum: Google [Bot], imstupidpleshelp, JoeWinograd, mikeyww, mmflume, Rohwedder, usser and 194 guests