Reply to note from "Martin J. Osborne" <dmarc-noreply@xxxxxxxxxxxxx> Fri, 22 May 2026 22:41:06 -0400
Martin,
> I want to open echocardiogram.txt.
It looks like x<Enter> would be the shortest way there.
Tangentially, I don't know if you've ever tried U2's "SmartDir" command. I use it all the time, and now I've ported it to QuickNotes as SD (see below). So, to take your example, commanding SD e,t would filter the directory entries down to files matching "e*.t*", including your target file. SD 2,s,p would list the 2014 "stress" file. (The last segment of the comma-delimited argument searches for extensions; everything preceding it searches for filenames.)
> But even though it can edit text-like files, I don't think it can
> create a non-md file (can it?).
Oh, sure. NE <filename.ext> creates any type of file you like: txt, html, etc. It's no different from XyWrite or any text editor in that respect. In scripting, WRITEFILE x "file" writes the contents of variable x to the file.
Here's SD. Add it to user.qnu and command RELOADLIB. Be sure to download the latest version of QuickNotes first.
SUB SD
#DOC: Smart Directory command eases the typing of filespecs
#DOC: Usage: `SD string1[,[string2],ext`
#DOC: SD tries DIR `string*.ext*`; if no match, #DOC: tries `strin*.ext*`, `stri*.ext*`,...`s*.ext*`, `s*.ex*`,
#DOC: `s*.e*` and, finally, `s*.*`
# CLD rev. 2026-05-23
#--------------------
IF NOT "$1"
DIR
EXIT
EI
QUIET/NV
PR
LOCAL n fnm ext farray spec
SET fnm = "$*"
SET ext = "*"
IF NOT CONTAINS("$fnm", ",")
SET fnm = "$fnm*"
GOTO :a
EI
SET fnm = REPLACE("$fnm", " ", "")
SET farray = SPLIT "$fnm" ","
SET fnm = ""
SET n = 1
WHILE $n < $farray[0]
SET fnm = "$fnm" . "$farray[$n]" . "*"
SET n = $n + 1
ENDWHILE
IF "$farray[$n]" SET ext = "$farray[$n]*"
:a
SET spec = "$fnm"
SET spec = "$spec.$ext"
CLERR
DIR $spec
IF NOT $ERROR
PR Files matching $spec
EXIT
EI
IF LEN("$ext") > 1
SET ext = TRIMRIGHT("$ext", 2)
SET ext = "$ext*"
GOTO :a
EI
IF LEN("$fnm") > 2
SET fnm = TRIMRIGHT("$fnm", 1)
IF SUBSTR("$fnm", LEN("$fnm") - 1, 1) != "*" SET fnm = "$fnm*"
GOTO :a
ELSE
PR No matching files
EI
ENDSUB
Download:
https://ammaze.net/xywwweb/dls/quicknotes.zip
--
Carl Distefano
cld@xxxxxxxxxx