March 31, 2014

Announcing Code Snippets

Filed under: Announcements,General — Marcus Tettmar @ 12:16 pm

Have you ever tried to send a piece of Macro Scheduler code (or any other code for that matter) to someone by email or instant messaging, or even in a forum, and found that it gets mangled? HTML strips leading spaces, characters get stripped or changed, and special characters get inserted and so on. Even when the code works it ends up looking ugly and is hard to read.

But now you can use our Code Snippets tool. You can access it via your Forum account and you’ll find it in the forum nav menu (top right of forum pages). Or go direct here (you’ll need to be logged into the forums – you can create an account for free if you don’t already have one).

Simply give your snippet a title and paste your code into the box. When you save it you’ll be given a special link which you can give to anyone, via email, forum, instant messaging, or however you like, and you can be sure that the recipient will be able to see your code, all nicely formatted and syntax highlighted. They can copy and paste it safely into a Macro Scheduler script without it being messed up, or they can view the raw file.

Here’s an example: http://www.mjtnet.com/snip.htm?g=533575bab6f58

You’ll also get a special forum embed code. Use this if you want to paste your code into a forum post. Instead of pasting your code, paste the embed code and then when your post is viewed it will display a nicely sanitized version of your code.

Over on the right of the Code Snippets page you’ll also see a list of snippets you’ve already made. If you need to grab the link or embed code just visit a snippet page and you’ll see the link and embed code at the bottom.

So, now, if you’re sending pieces of code to our support desk via email or live chat, to a friend or colleague or in the forums, please use Code Snippets. 🙂

Note that Code Snippets, as it’s name implies, is designed for small scripts and code examples. If you need to send a huge script to someone it’s probably best to send the raw script file as an attachment.