TypingAid icon indicating copy to clipboard operation
TypingAid copied to clipboard

Allow a way to quickly switch between different wordlists

Open ManiacDC opened this issue 10 years ago • 8 comments

From Mulleflupp:

Since I am working in the translation business, I am writing often in different languages and I needed a way to quickly switch word lists based on the language I am going to use so I added a feature to select your word list:

^!+t:: ;~ keyboard hotkey to quickly switch word lists
Loop, %A_ScriptDir%\WordList_*.txt ;~ Parse all files in the script directory that start with "Wordlist_" and have the file extension ".txt"
{
   AvailableWordLists .= A_LoopFileName . "|"
   Rows = %A_Index%
}
;~ Display a very simply GUI with a list box where you can choose from available word lists
Gui, SWL:New, AlwaysOnTop Border -SysMenu, Select Wordlist:
Gui, SWL:Add, Listbox, r%Rows% Sort Choose1 vSelectedWordList, %AvailableWordLists%
Gui, SWL:Add, Button, Hidden Default vButtonOK, OK
Gui, SWL:Show, AutoSize
Return

SWLGuiEscape:
SWLGuiClose:
Gui, SWL:Destroy
Return

SWLButtonOK:
Gui, SWL:Submit
FileCopy, %A_ScriptDir%\%SelectedWordList%, %A_ScriptDir%\Wordlist.txt, 1 ;~ Replace "Wordlist.txt" by selected word list and reload script
Reload
Return

Guess this could be better implemented in the code without the complete reloading of the script, but I didn't have time to dig in so deep at the moment.

ManiacDC avatar Oct 31 '14 12:10 ManiacDC

Additionally, it would be nice to allow the wordlists to automatically switch based on the program it's currently being used in (context-sensitive wordlists):

http://www.autohotkey.com/board/topic/49517-ahk-11typingaid-v2199-word-autocompletion-utility/page-51#entry688713

ManiacDC avatar Feb 20 '15 13:02 ManiacDC

Additionally, it should be noted that more than one wordlist should be allowed per program based on: http://www.autohotkey.com/board/topic/49517-ahk-11typingaid-v2199-word-autocompletion-utility/page-52#entry694546

ManiacDC avatar Apr 07 '15 19:04 ManiacDC

Also, should certain preferences be configurable per wordlist as well? or per application? See: https://github.com/ManiacDC/TypingAid/issues/72

ManiacDC avatar Feb 29 '16 12:02 ManiacDC

I still think there is a use case for command line options because starting a session in a pre-defined way one day, and a different way another is easier than remembering to switch settings/wordlists and knowing which settings or wordlists you are in at the time.

wolispace avatar Feb 29 '16 23:02 wolispace

I can see that. However, my ultimate plan is to make the wordlist in use to be context-sensitive. No manual switching needed. You just set up your rules and forget it.

ManiacDC avatar Mar 01 '16 12:03 ManiacDC

Sounds like a plan. If one of those rules is: "I'm starting this session from this PC on this day with this username so use that Wordlist.txt" then we are on a winner :-)

From my simple perspective I thought implementing a couple of command line args would be a quick fix, but I just checked out the source and it looks this this is all built with AutoHotKey scripts - wow... and I have no idea how easy AHK can read the command line.

wolispace avatar Mar 01 '16 23:03 wolispace

Hmm looks like this might read the command line:

; assume -w fileName.txt Loop, %0% { ;for each command line parameter If (%A_Index% = "-w") ;check for -w wordListFileName := A_Index + 1 ;assign next command line parameter as value wordListFileName := %wordListFileName% }

I think I now need to spend some time looking into this code to see what I can do with it :-)

wolispace avatar Mar 02 '16 00:03 wolispace

However, my ultimate plan is to make the wordlist in use to be context-sensitive. ... You just set up your rules and forget it.

I vote for an implementation such as this. Just throwing my $.02 at ya. ;) (akh coder here)

-t

TodWulff avatar Aug 26 '16 20:08 TodWulff