AutoHotkey Community

It is currently May 25th, 2012, 8:05 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Switch textplace?
PostPosted: October 22nd, 2007, 8:01 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 22nd, 2007, 8:15 pm 
Online
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
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

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 22nd, 2007, 8:27 pm 
Sweet. Works great!
Thanks man. =)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 22nd, 2007, 8:29 pm 
Offline

Joined: November 1st, 2005, 6:38 pm
Posts: 114
Location: Ottawa
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"


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 22nd, 2007, 8:37 pm 
engunneer:

I'm missing a space.
Test-one Test-two, becomes test-twotest-one.
Any tips?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 22nd, 2007, 9:18 pm 
Online
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
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

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: engunneer, kwfine, rbrtryn, tomL, vsub, Yahoo [Bot] and 39 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group