The PInvoke Live Template

A live template can call YOUR custom function when a user invokes it. For instance, a template could brings up a message saying "How disgusting." when a user types "GOTO", and then proceed to erase the GOTO.
There's a blog post that tells you how to extend this script schema. The extension involves writing a package with a new "script engine" and then calling that script engine from the live template XML file. The post contains a very good example of how to paste clipboard text wrapped around a try/finally block, by just typing clippy in the code and hitting TAB.
This got me thinking. Can we call external applications using live templates? "Of course you can.", is the right answer.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <hr> <sup> <!-- --> <blockquote>
  • Lines and paragraphs break automatically.
  • You can use context links in the text to create context-related links to pages or sites that provide additional information about a word or phrase.
  • Glossary terms will be automatically marked with links to their descriptions
  • Web and e-mail addresses are automatically converted into links.
  • Textual smileys will be replaced with graphical ones.
  • Scripture references will be linked automatically to an online Bible. E.g. John 3:16, Eph 2:8-9 (ESV).
  • You may link to webpages through the weblinks registry
More information about formatting options