AutoHotkey Community

It is currently May 27th, 2012, 10:17 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: 'Input' - Various uses
PostPosted: May 7th, 2004, 8:28 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
This shows global AutoReplace, with no leading key reqd. As this section runs as a separate thread (due to settimer) so it will not affect the concurrent main script execution.

Code:
#persistent
SetTimer, AutoReplace, 1000
SetKeyDelay, -1

AutoReplace:
   SetTimer, AutoReplace, off
   Input, UserInput, *V, {ESC}, btw,otoh
   IfInString UserInput, btw
      Send, {backspace 3}by the way
   IfInString UserInput, otoh
      Send, {backspace 4}on the other hand
   SetTimer, AutoReplace, on
return

_________________
Image


Last edited by Rajat on June 3rd, 2004, 7:09 am, edited 3 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 8th, 2004, 12:17 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
:moved:

_________________
Image


Last edited by Rajat on May 26th, 2004, 1:09 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 8th, 2004, 10:01 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
:moved:

_________________
Image


Last edited by Rajat on May 26th, 2004, 1:08 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 8th, 2004, 12:00 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Looks good. That got me thinking about adding this:

Try to remove the 16k limit from the Input, or at least have an option to have it delete half the text from the start (whenever needed) so that more room is made at the end, allowing the input to become indefinite.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 8th, 2004, 4:34 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
if unlimited text is easily addable then that'd be nice, it'll prove worthwhile in future ... like if we plan to do a AHK cmd AutoComplete using Input.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Terminate on space
PostPosted: June 2nd, 2004, 7:21 pm 
8) A way to avoid the limit (and make it more like other autoreplacers) is to terminate the input when space is pressed, using the %A_Space% variable. I use the following code:

Code:
#persistent
SetTimer,REPLACE,1000
SetKeyDelay,-1

REPLACE:
  SetTimer,REPLACE,Off
  Input,UserInput,*V,{ESC},%A_Space%

  SetEnv,in,btw
  SetEnv,out,by the way
  Gosub,TEST

  SetEnv,in,otoh
  SetEnv,out,on the other hand
  Gosub,TEST

  SetTimer,REPLACE,On
Return

TEST:

  StringLen,length,in
  EnvAdd,length,1
  IfInString,UserInput,%in%
    Send,{Backspace %length%}%out%%A_Space%
}
Return


Skrommel


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 3rd, 2004, 7:06 am 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
yep... that's an improvement!

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 3rd, 2004, 1:17 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
The new one (at the very top) is nice because it's so short. Using a timer to get a new quasi-thread is a nice idea.

The script might be slightly improved by having the timer fire only once, and then have that quasi-thread stay permanent by enclosing the contents of the timer's subroutine in an infinite Loop.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 23rd, 2007, 12:37 am 
Offline

Joined: December 27th, 2006, 8:31 pm
Posts: 88
Location: Louisville Kentucky
Rajat: The absolute most practical Use I can think of is one that (I think) is in high demand. If I had understood what you did here I would try and mash it up myself, (But I don't <-- NooB). Since this .ini/Trigger stuff works with compiled scripts, you could tweak the "HotkeyHelper" http://tangible.ca/articles/14/apps-universal-autocorrect-with-helper
to have a a radio button (Similar to the Slave script writer by Freak) where you could chose the end characters space enter tab custom or even prefix with Backtick, and when you hit send it would INiWrite to the appropriate section in the ini. Also you could include all of Jim Biancolos' <http://www.biancolo.com> Autoreplace scripts from Wikipedia's common mispellings list. You could write a short script to convert the list and then Bam! All the non-Spell checkers of the world rejoice (without having to learn anything about autohotkey)


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 14th, 2009, 1:28 pm 
Offline

Joined: February 28th, 2009, 6:45 pm
Posts: 9
Location: chicago
this is exactly what I've been looking--I have rheumatoid arthritis and use the quickcorrect and autoreplace features extensively in WordPerfect and Microsoft Word.

But I faithfully copied the formula below, and it worked when I typed the abbreviation "btw" in the google search window. I was thrilled -- but it only worked once. When I typed btw again in the Google search window, it did not work-- then I went into notepad, typed in btw, and again it failed to autoreplace.

You guys are light years beyond me -I installed ahk only about two weeks ago- can you tell me why this only worked once, and if the formula includes a time feature, could someone remove that feature, so that as long as the autoreplace hotkey is triggered, it will replace words in any function

thanks -- this would be a godsend to someone who for years has been typing in WordPerfect, then blocking and pasting into Google


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 14th, 2009, 6:22 pm 
mikeriia, is there any reason, why you don“t use hotstrings?
http://www.autohotkey.com/docs/Hotstrings.htm


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], specter333, XX0 and 25 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