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

<< < (2/16) > >>

Harrie:
Believe me, DC will definitely be getting publicity.  As a matter of fact, they would have been anyway.  I'm so taken away with this place, it is a wonderful site.  I'm only waiting until I'm a bit more familiar here, so that when I say what I have to say, I do it well.  Your programming this for me only shoots my opinion up about 90% higher!  

About the duplicate short forms, I meant if someone has:

mar25=March 25
mar25=0.25% Marcaine

Then, when you click on the Hotstrings script, it tells you there is a duplicate, the program won't run, and will exit.  As I said, that's really no big deal.  They can take them out manually.

If, for example, with tpptth=the patient presented to the hospital, one types tpptth, I would want it still to replace the hotstring, but show a tooltip of the phrase.  Your second example of possible completions would be incredible, beautiful.  That is what some popular expanders do now.  However, I am very happy at the moment.  Very!  Please feel more than free to stop here.  I'm wowed enough for one day.

Again, so many thanks.  

PS:  Just saw your last post.  I will definitely check it out. 

jgpaiva:
Oh, the tooltip is no problem. Here it is:

--- ---#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=
;the time for the display of the tooltip (in milliseconds)
TooltipTime=1000


loop,Read,%filetoread%,
{
string=%A_LoopReadLine%
StringSplit,result,string,=,
replaceable:=result1
replaced:=result2
FileAppend,:o*:%trigger%%replaceable%::`nSend`,%replaced%`nTooltip`,%replaced%`nSleep`,%tooltiptime%`nTooltip`,`nreturn`n`n,%filetowrite%
}
return
(notice you can change the tooltip display time)
The repeated entries checker can be done, but possibly it'd make more sense as another script.
The tooltip with the completions of the hotstring would have to be presented at autohotkey.com or to DC's ahk expert, Skrommel ;)

I'm so taken away with this place, it is a wonderful site.  
-Harrie (March 01, 2006, 11:56 AM)
--- End quote ---
My feelings exactlly ;)

I'm only waiting until I'm a bit more familiar here, so that when I say what I have to say, I do it well.-Harrie (March 01, 2006, 11:56 AM)
--- End quote ---
:Thmbsup: :Thmbsup:

jgpaiva:
This is yet another version of the script, now with a gui.
Hope you like it!

--- ---#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=
;the time for the display of the tooltip (in milliseconds)
TooltipTime=1000

MsgBox,4,Show Gui?,Do you want to use the gui interface?,30000
IfMsgBox,Yes
  GoSub,MostraGui
IfMsgBox,No
  GoSub,SemGui
return

MostraGui:
  Gui, Add, ListView,gLstView x9 y5 w240 h230 , Trigger String|Result String
  GoSub,UpdateListView
  Gui, Add, Button,gCreateFile +default x259 y-1 w65 h23 , &Create File!
  Gui, Add, Text, x259 y28 w36 h13 , Trigger:
  Gui, Add, Edit,vtrigger x259 y47 w120 h21 , %trigger%
  Gui, Add, Text, x259 y74 w90 h13 , Time for the tooltip:
  Gui, Add, Edit,vtooltiptime x259 y93 w33 h21 ,%tooltiptime%
  Gui, Add, Text, x259 y120 w59 h13 , File to Write:
  Gui, Add, Edit, x259 y139 w102 h21 vfiletowrite,%filetowrite%
  Gui, Add, Text, x259 y166 w60 h13 , File to Read:
  Gui, Add, Edit, x259 y185 w53 h21 vfiletoread,%filetoread%
  Gui, Add, Button,gReadFile x259 y212 w63 h23 , &Reload
  Gui, Show,,
  Return
 
ReadFile:
  Gui,Submit
  Gui,Destroy
  GoSub,MostraGui
  return
 
SemGui:
  loop,Read,%filetoread%,
  {
  string=%A_LoopReadLine%
  StringSplit,result,string,=,
  replaceable:=result1
  replaced:=result2
  FileAppend,:o*:%trigger%%replaceable%::`nSend`,%replaced%`nTooltip`,%replaced%`nSleep`,%tooltiptime%`nTooltip`,`nreturn`n`n,%filetowrite%
  }
  return
 
CreateFile:
  Gui,Submit
  loop,Read,%filetoread%,
  {
  string=%A_LoopReadLine%
  StringSplit,result,string,=,
  replaceable:=result1
  replaced:=result2
  FileAppend,:o*:%trigger%%replaceable%::`nSend`,%replaced%`nTooltip`,%replaced%`nSleep`,%tooltiptime%`nTooltip`,`nreturn`n`n,%filetowrite%
  }
  exitapp
  return 

LstView:

  return
 
 
UpdateListView:
  loop,Read,%filetoread%,
  {
  string=%A_LoopReadLine%
  StringSplit,result,string,=,
  LV_Add("",result1,result2)
  }
  return
 
GuiClose:
  Gui,Destroy
  Tooltip,File Creation Canceled
  sleep,%TooltipTime%
  Tooltip
  ExitApp
You can change all the paramters and hit [enter] (or the create file! button), and it will generate the hotstrings file.
If you change the file to read, you might want to reload the hotstrings list, that's what the "reload" button is for.
(notice that to disable the tooltip, you can just set the time to '0', and it won't appear ;))

Harrie:
What can I say about the GUI, I love it!  We all love them so, don't we?  <grin>  Thank you, this is near perfect now. 

One thing....the two later scripts put the trigger before the actual short form.  So for instance, with the latest one with the great place for putting in your trigger key and the create file button, if I put in a semicolon for the trigger and hit create file, then the hotstrings come out with the trigger before the short form.  For instance:

It creates this:


--- ---:o*:;aaor::
Send,ascending aorta
Tooltip,ascending aorta
Sleep,1000
Tooltip,
return

Rather than what I desire, which is this:


--- ---:o*:aaor;::
Send,ascending aorta
Tooltip,ascending aorta
Sleep,1000
Tooltip,
return

Oh, I can change it so easily with a find and replace that it's no biggee, but I would like to change it in the script itself.  I'm not sure how to do this, can you help me?

Lastly, I adore the tool tip!  I've even seen in the past how to do certain things with tooltips, such as center them, etc.  But, is it feasible to have the tool tip show before you hit the trigger key (the semicolon)?   

Thank you!  No rush at all - whenever.  Cheers.

jgpaiva:
Oops.. Sorry, I understood that trigger key would be the key before the hotstring.
No problems.
It is now modified, with the Trigger key at the end, and the tooltip appears before you hit the trigger. If you don't hit it for 3 seconds, or don't hit it at all, it isn't replaced. :D

Instructions:
This is the new gui:

On the left, there is the list of the several hotstrings located on the file listed under "file to read".
This uses a listview, which means you can list the hotstrings by name if you think there are some repeated ones (although probably tomorrow i'll do a version that checks for that ;)).

"Create File!" button, immediatelly creates the new hotstrings file, using the options that are displayed.

Trigger editbox let's you choose which trigger to use. Leaving it blank means there is no trigger and the hotstrings are used right after you write them.

Time for the tooltip edit box lets you choose the time you want the tooltip to be displayed, for every hotstring.

File to write editbox has the name of the file to write. This can be either a relative to the location of the script path, or an absolute path.

File to read editbox has the name of the file to read. This can be either a relative to the location of the script path, or an absolute path.

The "Reload" button makes the gui be reloaded with the new options, which basically means that the listview will display the hotstrings from the "file to read" edit box, in case you've changed it.
You don't have to reload to apply the "file to read" option, you can change it and click "create file!", but the listview will only be updated if the reload button is pressed.

If the trigger method is used, the generated hotsrings script will be case-sensitive. Please check this post for more information!

All the default configurations can be changed in the source file, in the variables at the beggining of the code, as in prior versions.

Selecting the non-gui version will use the default values, and closing the gui will cancel the creation of the new file.

Hope you like it! :D

.ahk file: http://jgpaiva.dcmembers.com/CS/HotStringScriptCreator/HotStringScriptCreator.ahk
.exe file: http://jgpaiva.dcmembers.com/CS/HotStringScriptCreator/HotStringScriptCreator.exe

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version