This is an idea I had for my script, it's been seen before in other scripts as well. I, however, modified the idea into a viewer and editor through a simple dialog in mIRC, so there is no need to use //run or go through all of your folders. Enjoy.
alias textview dialog -md textviewer textviewer
dialog textviewer {
title "Text Viewer"
size -1 -1 237 80
option dbu
list 1, 0 1 236 64, size
button "Run a text file", 2, 3 68 56 12, flat
button "Add a line of text", 3, 59 68 56 12, flat
button "Delete a line of text", 4, 115 68 58 12, flat
button "Exit", 5, 173 68 61 12, flat ok
}
on *:DIALOG:textviewer:sclick:*: {
if ($did == 2) {
set %tfilename $?="Enter text name here without the '.txt'."
did -r textviewer 1
loadbuf -ro textviewer 1 %tfilename $+ .txt
}
if ($did = 3) {
write %tfilename $+ .txt $?="Enter line of text."
loadbuf -ro textviewer 1 %tfilename $+ .txt
}
if ($did = 4) {
write -dl $+ $did(1).sel %tfilename $+ .txt
loadbuf -ro textviewer 1 %tfilename $+ .txt
}
if ($did = 5) {
unset %tfilename
}
}
menu channel {
.Textfile editor/viewer:textview
}