4. Generic Actions¶
This section explains how to create and edit generic actions.
4.1. Usage¶
A generic action is a simple way to access common tasks from the keyboard or the mouse.
Actions can also be defined as element of a plugin.
4.2. File location¶
To be recognized by the application, generic actions should be located in one of these folders:
%LocalAppData%/ORS/Dragonfly(version)/pythonUserExtensions/GenericActions (available for the current user)
%ProgramData%/ORS/Dragonfly(version)/pythonAllUsersExtensions/GenericActions (available for all users)
%ProgramData%/ORS/Dragonfly(version)/python/OrsPythonPlugins/OrsGenericAction/actions (distributed with the application)
4.3. File creation¶
To create a generic action, start the application,
start the OrsPythonPlugins.OrsGenericActionGenerator.OrsGenericActionGenerator
(found in Developer/Generic Action Generator),
fill in the required fields and press the button Create action.
4.4. File edition¶
Open the file in a text editor. Fill in the required methods.
For more information about actions, see ORSServiceClass.decorators.infrastructure.action().
4.5. Demos¶
Source code example:
Download the
file;Put that file into a generic action extension folder;
Start the application;
Open the Preferences and look in the Configurable Actions section for the name Demo: open folder pythonUserExtensions. Set an unused keyboard key for that action, apply the changes and exit the Preferences;
By using the specified action key, a file explorer will be opened at the pythonUserExtensions folder.