![]() | InDesign SDK 20.5 |
Public Member Functions | |
| ErrorCode | MyMethod (void) |
To use the template take the following steps.
Make a copy of SnpTemplate.cpp and rename it according to the function of your snippet, for example SnpCreateFrame.cpp. Verb-noun naming is recommended, CreateDocument, ModifyText, PerformDocumentAction and please use Snp prefix. The steps below use are based on the creation of snippet SnpCreateFrame.cpp.
Add your snippet (SnpCreateFrame.cpp) to the SnippetRunner projects.
Replace string "Template" with "CreateFrame". Note don't do the seemingly similar replace of "SnpTemplate" with "SnpCreateFrame" or the name of your snippet in the user interface won't get set properly.
There are normally two classes in a code snippet:
Edit the _SnpRunnerTemplate constructor code to describe your snippet to the framework.
Edit the _SnpRunnerTemplate::CanRun method to check the preconditions your snippet requires are met.
Edit the _SnpRunnerTemplate::Run method to get any parameters you want then instantiate and call your snippet.
Edit your functional methods(s) into your SnpTemplate class.
| ErrorCode SnpTemplate::MyMethod | ( | void | ) |
TODO: Replace with functional method(s).