Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News JavaScript Powered Macros in Visual Studio 2013

JavaScript Powered Macros in Visual Studio 2013

Many popular development environments offer a scripting language or similar method of automating common tasks to make ease life for the developer.  The Visual Studio Platform Team has released a new extension for Visual Studio 2013 that will allow developers to record and playback macros from within the editor. 

The extension works by storing commands that control Visual Studio directly through the DTE Interface.  A recorded macro can be replayed as needed, and can easily be edited within VS2013 like any other JavaScript file.  Users also have the ability to assign macros to specific hotkeys, and share recorded macros with other users.  (Macros are stored in a user’s local profile: AppData\Local\Microsoft\VisualStudio\12.0\Macros\Macros .)

There are a number of sample scripts provided with the extension to use and use as a basis for your own scripting.  Some of the scripts start simple with by inserting the current date & time while others toggle line numbers or head a header to all C# files in the active solution.  Having the source code in hand allows for more complex scenarios to be quickly designed and demonstrates how the extension can do more than just replay user keystrokes.

The extension is available now from the Visual Studio Gallery.  

Rate this Article