MarsEdit Help | Solutions By Topic | Q&A

Customizing Formatting Macros

Adding a custom formatting macro

MarsEdit supports sophisticated formatting macros to make quick work of editing the content of your posts. MarsEdit comes with a number of pre-installed formatting macros. If you wish to add additional HTML formatting styles, or a common block of text that you use frequently, it’s easy to add a custom macro to the menu.

Select the Format menu and choose the Customize... item at the bottom of the menu. The formatting macro editor will appear. Items in the window appear in the same order as they will appear in the Format popup menu. Click and drag items to rearrange them. You may also add separator items to the menu.

Custom Formatting Macro Editor screen shot

To add a new macro, click the + button. A sheet will appear, allowing you to give the macro a name and enter the start and end parts of the macro.

Custom Formatting Macro Editor screen shot

The closing part of the macro is optional. You can even use the formatting macros for non-HTML snippets. Anything you don't want to have to re-type is appropriate for a custom formatting macro.

Editing keyboard shortcuts

You may have noticed the Shortcut field in the macro editor sheet above. To set a custom keyboard shortcut for any item in the markup menu, just select the text field and press the desired keyboard combination.

Don't worry about choosing a keyboard shortcut that is already used by MarsEdit. If a conflict occurs, MarsEdit will inform you of the situation, and prevent your using the shortcut.

Using advanced placeholder templates

Use the Insert Placeholder popup menu to select from a number of convenient template items that make formatting macros in MarsEdit even more powerful. For instance, a formatting macro can be configured to incorporate the contents of the pasteboard into the generated markup. Now when you want to copy and paste from another application into a specific formatting macro, you can do it in one easy stroke.

Templates are always enclosed with hash characters ('#') to set them apart from the rest of your macro. The entire content of the placeholder will be replaced when the macro is applied. The popup menu contains a more common description of the purpose of the placeholder. Here is a description of each of the placeholder templates available to you. After the description, a typical example of the literal placeholder is included.

Ask for URL
Asks the user for a URL and uses it as the replacement. (#askurl Enter a URL:#)
Ask for Text
Asks the user for any text and uses it as the replacement. (#asktext Enter text:#)
Paste URL
Uses the contents of the pasteboard as the replacement, attempting to interpret it as a URL. (#pasteurl#)
Paste Text
Uses the contents of the pasteboard as the replacement. (#pastetext#)
Selected Text
Uses the current selection in the MarsEdit post editor as the replacement. (#selection#)

Notice that the "ask" variations allow a custom prompt to be associated with the placeholder. This prompt text will be used in the alert sheet that is presented to the user when the formatting macro is applied.