 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Badchx Guest
|
Posted: Mon Oct 22, 2007 7:01 pm Post subject: Switch textplace? |
|
|
Hi
I'm all new to ahk, and I wonder if there's a script that can do the following.
I work with a system there I very often need to switch the place between two words.
Ex.
Test-one Test-two
I just want to mark them with the mouse and dobbelclick the caps lock button or something so they switch place.
Test-two Test-one
Is that possibe?
Hope someone can help me or give me a direction where to look. |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Mon Oct 22, 2007 7:15 pm Post subject: |
|
|
seems possible, though doubleclick of capslock is the hardest part.
| Code: |
#Capslock::
Send, ^c
Clipwait, 0.5
StringSplit, array, clipboard, %A_space%
Loop, %array0%
{
item := (array0 - A_index) + 1
SendRaw, % array%item%
}
Return
|
Activate with Win+Capslock _________________
(Common Answers) |
|
| Back to top |
|
 |
badchx Guest
|
Posted: Mon Oct 22, 2007 7:27 pm Post subject: |
|
|
Sweet. Works great!
Thanks man. =) |
|
| Back to top |
|
 |
ggirf14
Joined: 01 Nov 2005 Posts: 108 Location: Ottawa
|
Posted: Mon Oct 22, 2007 7:29 pm Post subject: |
|
|
Simple ideal
| Code: | Hotkey, ^1, label1
Hotkey, ^2, label2
Return
Label1:
Send, Test-one
Return
Label2:
Send, Test-two
Return |
Select the text to replace than ctrl+1 wil replace selected text with "test-one"
Same with ctrl+2 "Will write test-two" |
|
| Back to top |
|
 |
badchx Guest
|
Posted: Mon Oct 22, 2007 7:37 pm Post subject: |
|
|
engunneer:
I'm missing a space.
Test-one Test-two, becomes test-twotest-one.
Any tips? |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Mon Oct 22, 2007 8:18 pm Post subject: |
|
|
sort of a hack, but
| Code: |
#Capslock::
Send, ^c
Clipwait, 0.5
StringSplit, array, clipboard, %A_space%
Loop, %array0%
{
item := (array0 - A_index) + 1
SendRaw, % array%item% . " "
}
Send {bs}
Return
|
_________________
(Common Answers) |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|