This is a simple script that lets you take notes inside a custom window.
Guide:
Type "/notes (optional name)" to open a notes window, if no name is given it will use the first open number available. (spaces are replaced by _)
You can type text into the text editor and hit enter to add the note to the window.
Select one or multiple lines and press the delete key to remove selected lines.
Notes will automatically be saved to file and when a notes window is closed you will be prompted to delete the note. If you hit yes the note will be deleted if you select no the note will be saved and can be opened at a later time.
There is an option to automatically load notes when mirc starts, this can be turned on/off in the right click menu which is available in all windows.
Also included in the right click notes options is the ability for bring open notes to focus and reopen closed notes. When a note window is reopened the size and location are remember.
If you use the alias command and give a name that is being used if the note is closed the note will be reopened and if the note is already open it will gain focus.
Updates:
You can edit entries in notes now. Please read complete before complaining about it doesn't work or is buggy.
Select a single line (won't work with multiple lines selected) then press "e" and the text will appear in the editbox. You can then edit the text and hit enter and it will replace the selected line.
Make sure no lines are selected when trying to type new notes, since if a line is selected and you press e it will replace the editbox with that line and go into edit mode. You can either hold ctrl and click selected lines to deselect them or right click below the lines in the window to deselect all lines
I think I remembered all the features and if you have any problems please let me know here.
Remarks:
When I was thinking how to save notes savebuf and loadbuf immediately popped into my head and they are great. But then when I was basically done I thought hey an ini would probably be a better place to store the info. Since it'd all be in a single file and wouldn't be any harder to access after making simple write/read aliases. So I'll probably redo this thing using an ini for saving notes.
meh if i'm going to continue adding features it'd probably just be best to switch to using a dialog, though i don't know if you can make them user resizeable.
/*
[Addon]
Script=Notes
Version=1
Author=pball
Desc=Create and manage simple notes
For=Mirc
Date=12-20-12
[script]
*/
alias notes {
if ($1) && ($isfile(notes\@Notes_ $+ $replace($1-,$chr(32),_) $+ .txt)) && (!$window(@Notes_ $+ $replace($1-,$chr(32),_))) loadnotes notes\@Notes_ $+ $replace($1-,$chr(32),_) $+ .txt
elseif ($1) && ($window(@Notes_ $+ $replace($1-,$chr(32),_))) window -a @Notes_ $+ $replace($1-,$chr(32),_)
elseif ($1) {
window -e0lk0 @Notes_ $+ $replace($1-,$chr(32),_) 100 100 300 200
savenotes @Notes_ $+ $replace($1-,$chr(32),_)
}
elseif (!$1) {
set -l %num 1
while ($isfile(notes\@Notes_ $+ %num $+ .txt)) inc %num
window -e0lk0 @Notes_ $+ %num 100 100 300 200
savenotes @Notes_ $+ %num
}
}
on *:input:@Notes_*: {
if (!%noteedit) aline $target $1-
else { rline $target %noteedit $1- | unset %noteedit }
savenotes $target
halt
}
on *:keyup:@Notes_*:*: {
if ($keyval == 46) && ($sline($target,0).ln > 0) {
while ($sline($target,1).ln) dline $target $v1
savenotes $target
}
elseif ($keyval == 101) && (!%noteedit) && ($sline($target,0).ln == 1) {
set %noteedit $sline($target,1).ln
editbox $target $sline($target,1)
}
}
on *:start: {
if (!$isdir(notes)) mkdir notes
if (!isfile(notes\popup.txt)) {
write notes\popup.txt Notes
write notes\popup.txt .$iif(%loadnotes,$style(1)) Load notes on Start: $($iif(%loadnotes,unset %loadnotes,set %loadnotes true),0)
write notes\popup.txt .-
write notes\popup.txt .$submenu($menunotes($1))
}
if (%loadnotes) noop $findfile(notes,@Notes_*,0,loadnotes $1-)
}
alias savenotes {
write -c notes\ $+ $1 $+ .txt $window($1).x $window($1).y $window($1).w $window($1).h
savebuf -a $line($1,0) $1 notes\ $+ $1 $+ .txt
}
alias loadnotes {
window -e0lk0 $gettok($gettok($1-,-1,92),1,46) $read($qt($1),1) notes\popup.txt
if ($calc($lines($qt($1-)) -1) > 0) loadbuf $v1 $gettok($gettok($1-,-1,92),1,46) $qt($1-)
}
on *:close:@Notes_*: {
savenotes $target
.timer -m 1 10 closenotes $target
}
alias closenotes { if ($?!="Delete $1 $+ ") .remove -b notes\ $+ $1 $+ .txt }
menu Menubar,Query,Nicklist,Channel,Status {
Notes
.$iif(%loadnotes,$style(1)) Load notes on Start: $iif(%loadnotes,unset %loadnotes,set %loadnotes true)
.-
.$submenu($menunotes($1))
}
alias menunotes {
if ($1 isnum) && ($findfile(notes,@Notes_*,$1)) {
set -l %fn $v1
return $iif($window($gettok($gettok(%fn,-1,92),1,46)),$style(1)) $gettok($gettok(%fn,-1,92),1,46) $+ : $+ $iif($window($gettok($gettok(%fn,-1,92),1,46)),window -a $v1,loadnotes %fn)
}
}