ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

DONE: abbreviations importer

(1/16) > >>

Harrie:
How feasible is this scenario:

I am a medical transcriptionist.  Many of us have thousands of word and phrase abbreviations in the expanders we use. 

Example: 
hthym = hypothyroidism
tpptth = the patient presented to the hospital

The request is - if the above format is put into a plain text file, and/or the same format but no spaces before or after the equal sign, can someone make a script that would put them all into an AHK hotstrings file?  I would like it so that somehow, before importing the list, the user could specify whether they want the trigger key to be the spacebar, the semicolon key, or whatever other key they choose. 

Thanks for letting me ask.  Thanks for this forum.

jgpaiva:
I think the following code should solve your problem.
I've tested it and it seems to be working :D
It only has one limitation.
The text to be replaced cannot end with a space, and the text to replace cannot start with a space, or you'll need to add that space to trigger the hotstring.
i.e. the text file accepts the following format:
hthym=hypothyroidism
tpptth=the patient presented to the hospital

Oh, and another thing: the hotstrings cannot have '=' in it ;)
These two issues can be solved if you really need them.
Here's the code:


--- ---#SingleInstance,Force
;filetoread contains the name of the file to read
filetoread=textfile.txt
;file to write contains the name of the file to write
filetowrite=hotstringsScript.ahk
;to add a trigger, put it after the '='.please notice that colons have to be added like this: `, 
trigger=

loop,Read,%filetoread%,
{
string=%A_LoopReadLine%
StringSplit,result,string,=,
replaceable:=result1
replaced:=result2
FileAppend,:o*:%trigger%%replaceable%::%replaced%`n,%filetowrite%
}
return
Only one doubt:
Do you want an executable or the ahk script?

Harrie:
That is incredible!  I'm awe-struck.  This is just tremendous for me!  I suspected it might be easy for some of you and fast, but wow, you whipped it up immediately!

Not being able to have the equal sign in a hotstring should not be any problem at all.  None.  Nor the space issue.   

I tried it on a very large text file (35 pages worth of phrases when I opened it with MS Word), and it took them beautifully.  And fast.  If a person has duplicate short forms, the resulting Hotstrings file won't run until they are taken out or changed.  I think, right now, that is fine.  Let the person deal with those.  Maybe I'll think on that.

I don't need an executable, this is fine.  This is okay to share with other MTs? 

Wow, can't get over it.  Is it terribly much a whole 'nuther ballgame (difficulty-wise) to make them have tooltips, such that when you hit your short form keys (tpptth) you'd get a tooltip showing you the matching phrase?  I'm just asking here, I know it wasn't in my original request.  I may make a new post with such a request!   :D

Well, I have more playing to do.  I feel really appreciative.  You probably can have no idea, LOL.  Thank you, jgpaiva!  Great job!

jgpaiva:
I hope i understood your post correctly. (I have a few problems with understanding English :()

If a person has duplicate short forms, the resulting Hotstrings file won't run until they are taken out or changed. 
-Harrie (March 01, 2006, 11:20 AM)
--- End quote ---
Sorry, didn't get what you mean.

This is okay to share with other MTs?
-Harrie (March 01, 2006, 11:20 AM)
--- End quote ---
No problem with sharing, please do. (But some publicity for DC would be nice ;) )

Wow, can't get over it.  Is it terribly much a whole 'nuther ballgame (difficulty-wise) to make them have tooltips, such that when you hit your short form keys (tpptth) you'd get a tooltip showing you the matching phrase?
-Harrie (March 01, 2006, 11:20 AM)
--- End quote ---
Do you mean if you have this defined:

--- ---tpptth=the patient presented to the hospitalif you type tpptth, the hotstring would not be replaced but there would appear a tooltip?
or do you mean if you type tpp, the possible completions would appear?
The first one is easy to do. The second one, could be impossible (at least with my knowledge ;) )

Thank you, jgpaiva!
-Harrie (March 01, 2006, 11:20 AM)
--- End quote ---
:D No problem, it's good to know i contribute to the community ;)

jgpaiva:
BTW, this other script might intrest you: http://www.autohotkey.com/forum/viewtopic.php?t=2066
It's a hotstring manager, gui-like.
It is defined to look in a file named "HotString_Defs.ahk" for hotstrings, and then add them to a gui. When you press ctrl + alt + A, it opens a manager where you can delete hotstrings and add new hotstrings.
Looks good ;)

Navigation

[0] Message Index

[#] Next page

Go to full version