AutoHotkey Community

It is currently May 27th, 2012, 3:44 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: July 25th, 2010, 12:59 am 
Offline

Joined: August 4th, 2009, 3:58 am
Posts: 373
Hello,

I'm trying to understand how Auto-Replace works and after reading the documentation page here:

http://www.autohotkey.com/docs/Hotstrings.htm,

I'm still not sure what's wrong. The main problem is that I am getting variable results (i.e. it works sometimes but then not at all later even though the code has not changed). Here are a few simple replacements I want to make:

Code:
:: mer :: merchant
:: ms :: merchant services
:: w :: with
:: unv :: univeristy
:: n :: and
:: ppl :: people
:: cc :: credit card
:: bldg :: building
:: srvc :: service
:: sys :: system
:: u :: you
:: tk :: take
:: tho :: though

By the way, I've tried starting them with :*: rather than :: and I have also tried putting #Hotstring r c at the beginning.

Also, the beginning and ending spaces in both the abbreviations and the results are presnt intentionally in order to prevent the command from launching when the letters in the abbreviation happen to be present at the beginning/middle/ending of a word (i.e. "mer" in "merger" or "ms" in "arms", etc.). If there is an easier way to prevent that, I'd love to know what it is.

Thanks for any help you can offer.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 25th, 2010, 1:24 am 
the article you linked wrote:
(however, by default you must type an ending character after typing btw, such as a space, period, or enter).
http://www.autohotkey.com/docs/Hotstrings.htm#EndChars


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 25th, 2010, 6:12 am 
Offline

Joined: August 4th, 2009, 3:58 am
Posts: 373
Thanks. That's just what I needed.

Now, is there an easy way to accomplish the same thing without having to use the leading and trailing spaces? The leading space becomes a problem if the word begins an entry like the word "Thanks" at the beginning of my post. The trailing space is a problem if the word has punctuation right after it.

I'm a quadriplegic with paralyzed fingers so typing is difficult, thus, every keystroke I can eliminate will help. I'm looking for the best/easiest way to abreviate as many words as possible.

Thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 25th, 2010, 6:37 am 
dsavant wrote:
Thanks. That's just what I needed.

Now, is there an easy way to accomplish the same thing without having to use the leading and trailing spaces? The leading space becomes a problem if the word begins an entry like the word "Thanks" at the beginning of my post. The trailing space is a problem if the word has punctuation right after it.

I'm a quadriplegic with paralyzed fingers so typing is difficult, thus, every keystroke I can eliminate will help. I'm looking for the best/easiest way to abreviate as many words as possible.

Thanks
everything you ask for, is the default behaviour of Hotstrings.
So remove the spaces and it will work.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 25th, 2010, 7:56 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
You may also be interested in TypingAid http://www.autohotkey.com/forum/topic53630.html

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 25th, 2010, 9:31 am 
Offline

Joined: September 15th, 2009, 1:14 am
Posts: 562
You can also check out Texter.
It's made from AutoHotkey code, and I first found it on Lifehacker.
They have the source somewhere also (either here or on lifehacker, I forget where and don't feel like searching).
But here's the link: http://lifehacker.com/238306/lifehacker ... er-windows


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2010, 2:20 pm 
Offline

Joined: August 4th, 2009, 3:58 am
Posts: 373
Texter appears to be just what I need. Do you know of a way to import a large list of abbreviation/text pairs to avoid having to load them one-at-a-time?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2010, 2:25 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
dsavant wrote:
Texter appears to be just what I need. Do you know of a way to import a large list of abbreviation/text pairs to avoid having to load them one-at-a-time?
You may wish to try it for a while first (some people have reported it to be unreliable at times, depends on the PC I suspect). as far as I know there is no easy way to import a large list (but you can try via the Bundle menu and see what happens)

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2010, 4:57 pm 
I have done work with the original Texter code for some clients, not that that makes me an expert.

The Import feature would sound hopeful, but it isn't.

In order to mass load Texter you would need code to read your input file and then create the files Texter needs to point at your substitutions (one file, in the bank sub-dir, points to the actual replacement file names - the names are the trigger that you type in, but converted to numbers to allow for embedded special characters) and the other file, in the replacements sub-dir, is just the text to be substituted.

*some day* I am going to rewrite Texter to fix all the problems I fixed for those clients AND make the code less unwieldy.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2010, 5:19 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
ScottMattes (offline) wrote:
*some day* I am going to rewrite Texter to fix all the problems I fixed for those clients AND make the code less unwieldy.
Interesting I'm sure (you are aware of the Texter GIT so you can check in improvements?), anyway, if you are interested in texter like apps let me know as I may have something to test for you :wink:

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2010, 6:45 pm 
Offline

Joined: May 21st, 2007, 3:44 pm
Posts: 176
Location: USA
Yes, I have found the GIT - when I last checked no one, not even the author, had made any changes.

Please put me down on the list of interested alpha/beta testers!

_________________
-------------
Scott Mattes
Image
My small, and slowly growing, collection of scripts.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 27th, 2010, 2:50 am 
Offline

Joined: August 4th, 2009, 3:58 am
Posts: 373
Thanks a bunch for the great comments.

avant ds wrote:
everything you ask for, is the default behaviour of Hotstrings.
So remove the spaces and it will work.

As I mentioned above, I have attempted different approaches including:
dsavant wrote:
starting them with :*: rather than :: and I have also tried putting #Hotstring r c at the beginning.

However, there always seem to be a bunch of errors. I also went back and tried your suggestion (again) of getting rid of the spaces

...with this code (note the absence of spaces) :
Code:
::mer::merchant
::ms::merchant services
::w::with
::unv::university
::n::and
::ppl::people
::cc::credit card
::bldg::building
::srvc::service
::sys::system
::u::you
::tk::take
::tho::though

Here are the type of results I have gotten:
uuniversty i
ppeople
Bilding u
Uyou
nand
bbuilding
Tke a
wwh t
tthough
ccredit card

The small amount of testing I have done with Texter is encouraging to me in light of my disability. However, there are clearly some concerns here about Texter and its reliability. Do you think I am better off trying to create my own custom auto-replacements? I'm still quite a noob at AHK and have no other programming-type experience at all. The concern I have has to do with handling all of the different possibilities when a particular word is entered. This includes capitalization at the beginning of sentences, punctuation, etc.

I think I will start a new thread with the word "Texter" in the title in the hopes that someone may notice it who has already built something to improve on it.

By the way, I did create a pretty basic script for inputting my abbreviations/text pairs with the idea that I can just place my word list and the Texter app next to each other on my screen and have it just go back-and-forth putting in one word at a time:

Code:
 #t::   ;         >>>>>>>> Add new to Texter >>>>>>>>         
CoordMode, Mouse, Relative   ;                  
MouseClick, Left, 380, 85   ;      click formula bar            
Sleep, 50   ;                  
Send {End}   ;         select contents         
Sleep, 50   ;                  
Send {Shift Down}   ;                  
Sleep, 50   ;                  
Send {Home}   ;                  
Sleep, 50   ;                  
Send {Shift Up}   ;                  
Sleep, 1000   ;                  
Send ^c   ;            copy      
Sleep, 1000   ;                  
Send {Tab}   ;         move to next cell         
Sleep, 50   ;                  
SetTitleMatchMode, 2   ;                  
WinActivate, Texter   ;                  
WinWait, Texter   ;                  
Sleep, 50   ;                  
CoordMode, Mouse, Relative   ;                  
MouseClick, Left, 50, 410   ;      open add new hotstring box            
Sleep, 50   ;                  
CoordMode, Mouse, Relative   ;                  
MouseClick, Left, 25, 75   ;      click hotstring entry box            
Sleep, 1000   ;                  
Send ^v   ;            paste      
Sleep, 1000   ;                  
Send {Tab}   ;         move to text entry area         
Sleep, 1000   ;                  
SetTitleMatchMode, 2   ;                  
WinActivate, TexterList   ;                  
WinWait, TexterList   ;                  
Sleep, 50   ;                  
CoordMode, Mouse, Relative   ;                  
MouseClick, Left, 380, 85   ;      click formula bar            
Sleep, 50   ;                  
Send {End}   ;         select contents         
Sleep, 50   ;                  
Send {Shift Down}   ;                  
Sleep, 50   ;                  
Send {Home}   ;                  
Sleep, 50   ;                  
Send {Shift Up}   ;                  
Sleep, 1000   ;                  
Send ^c   ;            copy      
Sleep, 1000   ;                  
Send {Tab}   ;         move to next cell         
Sleep, 50   ;                  
SetTitleMatchMode, 2   ;                  
WinActivate, Add new hotstring   ;                  
WinWait, Add new hotstring   ;                  
Sleep, 1000   ;                  
Send ^v   ;                  
Sleep, 1000   ;                  
Send !o   ;            click OK      
Sleep, 50   ;                  
SetTitleMatchMode, 2   ;                  
WinActivate, TexterList   ;                  
WinWait, TexterList   ;                  
Sleep, 50   ;                  
Send {Down}   ;                  
Sleep, 50   ;                  
Send {Left 2}   ;         ready for the next one         
Sleep, 50   ;                  
return   ;   


That is still a lot faster than trying to type them. However, as has been the case many times in the past, I am having problems with Send ^v working not. I started a thread about that as well:
http://www.autohotkey.com/forum/viewtopic.php?t=60689
...but thought I would mention it here too in case you have any suggestions.

Thanks again for the input.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 28th, 2010, 7:55 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
dsavant wrote:
Code:
::mer::merchant
::ms::merchant services
::w::with
::unv::university
::n::and
::ppl::people
::cc::credit card
::bldg::building
::srvc::service
::sys::system
::u::you
::tk::take
::tho::though

Here are the type of results I have gotten:
uuniversty i
ppeople
Bilding u
Uyou
nand
bbuilding
Tke a
wwh t
tthough
ccredit card


Don't give up on regular AutoHotkey (texter sends and it is AutoHotkey so AutoHotkey should work the same if not better)
Did you try various send methods? Try adding these at the top of your script and play with it.

SendMode wrote:
Makes Send synonymous with SendInput or SendPlay rather than the default (SendEvent). Also makes Click and MouseMove/Click/Drag use the specified method.
Source: http://www.autohotkey.com/docs/commands/SendMode.htm


SetKeyDelay wrote:
Sets the delay that will occur after each keystroke sent by Send or ControlSend.
Source: http://www.autohotkey.com/docs/commands/SetKeyDelay.htm


Do you have any other hotkey related programs installed? They CAN and will interfere with AutoHotkey.

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Texter fies
PostPosted: July 16th, 2011, 8:16 pm 
[quote="
*some day* I am going to rewrite Texter to fix all the problems I fixed for those clients AND make the code less unwieldy.[/quote]

In your working with fixes, did you come across a possible cause for a common issue with Texter (on Windows systems) -- after a time, the ability to drag and drop files or folders just quits working in Windows. You can still re-position a window, but when you click to move an icon or a file, nothing happens; system has to be restarted.

No doubt it's Texter; you can Google search "Texter + Drag+ Drop+issues" and find it is a well known, but as yet unsolved problem.

I don't know if it is a wider AHK-based problem, of just something in Texter code; I could not find anything in a search of the AHK site.

Insight would be very helpful, here or email gofidelity (@) gmail.com


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: bobbysoon, Wicked and 20 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