» Home

  » Plugins

      » Mime

            » Custom Action Wizard

Brass Plugins: Mime

 

The Custom Action Wizard: Adding an Application

Custom actions work in exactly the same way as developed plugins. When they're created, they look exactly like every other plugin you have. The difference is that you have complete control.

Let's walk through adding a new application to Mime. We're going to enable Notepad to receive gestures again, but this time we're going to do it properly. Previously we simply used the "All Applications" criteria plugin, now we're going to give Notepad an entry in Mime all of its own. We'll also add the custom action of "File - Save".

To access the Wizard, simply click the "Custom Action Wizard" button underneath the "Available Actions" tree. The Wizard intro screen will appear.

 

We want to add a new custom application, so select the top option and click "Next".

 

This is where you name the new application entry. We're adding Notepad to Mime, so I think "Notepad" is a good application name and "Notepad.nfo" is a good filename to store our configuration in. All custom applications and actions are stored in a file with a ".nfo" suffix, so if you don't add ".nfo" to the filename it will be added for you. Fill out your wizard page as per the screenshot, and click "Next".

 

Now we need to name our first custom action for this application. We're going to configure an action to get Notepad to save the current file, so "FileSave" is a good name for the action. You can also provide a descriptive name for this action.

What's the difference? The action name is what Mime uses to internally refer to your action. The descriptive name is what Mime uses when displaying your action in the configuration trees. So if you add a gesture to this action and then rename it, what you're actually renaming is the descriptive name. If you don't provide a descriptive name, Mime uses the action name instead.

In a sentence: The action name never changes, the descriptive name can be changed.

Fill out your wizard page as per the screenshot, and click "Next".

 

Now we come to the confusing part :-). Criteria are how Mime understands which application you want to add an action to. To fill out the fields in this wizard page, run Notepad (Start - Run - Notepad). When the Notepad window opens, move the mouse to the windowfinder icon ( ), click and hold the left mouse button, then drag the icon over to the Notepad window. If you do this correctly, your Wizard page will automatically be filled out like the screenshot above. This means that Mime has recognised Notepad as an application.

We're not done though. Edit the fields in your Wizard page so they look like this:

 

Most of the fields are now blank. Selecting criteria is a bit of an art, and it is covered in detail in Writing Good Criteria. So for now just continue following this guide and we'll go through criteria in a little bit.

Once you've filled out the Wizard page as per the screenshot above (the mostly blank one), click "Next".

 

This is the directive configuration page, where you tell Mime what you want this action to do. In the "Directive Type" combobox you can select from various directive types. Each directive has a specific meaning, for example "Keyboard: Hold ALT and send keys" pretty obviously emulates pressing ALT and then some keys in the application.

To get Notepad to do a File - Save, we would hold ALT, press "F", release ALT, and finally press "S". Try it in Notepad if you don't see what I mean, it's the standard keyboard accelerator.

To configure this first select "Keyboard: Hold ALT and send keys" in the comobobox. You'll see parameter boxes 1 & 3 change to reflect your ALT key press, and parameter box 2 become enabled. In parameter box 2, type "F" (without the quotes) then click the big "Add this directive" button. In the text box at the bottom of the screen, "[ALT DOWN]f[ALT UP]" will be added.

Next we want to send a normal keypress of "S". Select "Keyboard: Simple keypress" and type "S" into parameter box 1, then click "Add this directive".

When you've done it, your complete directive line at the bottom of the wizard page will look like the one in the screenshot above.

This wizard page makes it easier for new users of Mime to create directives. If you're a bit of an expert user you can type your directive line straight into the bottom edit field.

To find out about all the directives Mime supports and how to use them, please visit the Supported Directives page. It's linked from the main Mime page too, so you can go and read it after you've finished this walkthrough.

Click "Next" once you've created the directive for our "File - Save" action.

 

Here you can give a description for the action you've created. This is displayed in the bottom left of the Mime gesture configuration screen when you click on the action. Type any description you like and click "Next"

 

You're done! This final page is a summary of your configuration choices. Take a moment to read through it and make sure everything is as you expect. Your changes are not made until you click "Finish", and you can click "Back" at any time.

Before you click "Finish", you can tick "Restart the Wizard after my changes have been made". This is handy if you want to add a lot of applications or actions and saves you restarting the Wizard each time.

That's it - you've created a new application and "File - Save" action that will only apply to Notepad! You add a gesture to it in exactly the same way as normal - find it in the "Available Actions" tree and click the right arrow button.