# Using profiles to extend your action

There are some situations where you will want a given action behave slightly differently depending on the currently selected items or the current runtime environment.

## Open a terminal here

Say you have an action which opens a terminal in the current location.

You have configured it to open your preferred terminal in the location your file manager currently points to.

But what if you want to select a directory in your file manager, and directly open your terminal in this directory ? If you keep based on the current file manager location, your terminal will open in the parent of the targeted directory.

One solution is to define a new profile to your action, configuring this profile to open the terminal in the targeted directory.

At runtime, &prodname; will successively examine each profile attached to your action. If the first profile targets a file while you have selected a directory, then &prodname; will just try with your second profile.

To create a new profile, first select the action in the items list, then choose File New profile .

A new profile is created in your action.

You can now define the conditions which must be met in order this profile be selected, and the command which will be executed.

## Ordering the profiles inside an action

At runtime, &prodname; will begin with examining the conditions set on your action.

If these conditions (the action-conditions) are met, then &prodname; will examine in order each profile.

If the conditions defined in a profile are met, then this profile will be validated, and the review of other profiles will stop.

If no profile is found valid at runtime, then the action will be itself considered invalid, and will not be displayed in the file manager context menu.

Profiles of an action are ordered, and they are examined in that order at runtime. The first profile whose conditions are met will be validated, and made selectable in the &nautilus; context menu.

So, ordering of the profiles may be important for your action: the first valid profile found is the only one selected.

You may order your profiles inside an action in two ways.

1. Cut the profile to be moved, select the profile before which you want your cut profile to be inserted, and paste it.

2. Click on the profile to be moved, and drag it to its right place.