AppleScript The BASIC Technics is literally a series of basic AppleScript techniques.
The "contextual menu" appears when you click the right (secondary) mouse button while a file is selected in the Finder.
The ability to display and execute user-prepared AppleScripts here is not provided by default in macOS.
In order to display/execute AppleScript there, you need to use some tool together.
This is an easy-to-understand book that explains how to create contextual menu scripts with the Automator, Shortcut, and Service Station tools, which appear when you click the right (secondary) mouse button while a file is selected in the Finder.
PDF 41 pages, sample Zip archive attached