How to create a blank RTF file in AppleScript inside current folder?
If you want to use the code in that linked answer, as is, and modify it to do exactly what it's presently doing with the exception of creating the RTF file at the location the Finder window is set to, via the .app added to the Toolbar in Finder, then change the following line of code:

Change:

set theCustomRichTextFilePathname to ((path to desktop) &amp; customFilename &amp; ".rtf") as string


To:

tell application "Finder"
    set theCustomRichTextFilePathname to ((folder of the front window as string) &amp; customFilename &amp; ".rtf") as string
end tell


Then save it as an AppleScript .app, not .scpt, and drag and drop it onto the Toolbar in Finder.

While that technically answers your question, nonetheless there's probably other code that may/will need to be modified, but that gets you started.