You are on page 1of 13

MindManager Macros Masterclass v0.

1
(Preview)
© 2016 Harport Consulting. All Rights Reserved.

MindManager Macros Masterclass v0.1 (Preview)

Published 29/05/2016

From _MindManager Macros Masterclass.mmap v158 29/05/2016 09:21:08

Mindjet internal training preview, not for external use. Topics with grey text are still under development at this version.

1 Aucune entrée de table des matières n'a été trouvée.Welcome


Welcome to this short course on using the macro capabilities built into MindManager® for Windows.

This course applies to MindManager for Windows only, and not to any other versions on other platforms.

Naturally, it is delivered as a MindManager map. It makes extensive use of many of MindManager's features,
especially the indexing of content in the Marker Index task pane.

1.1 Who this course is designed for

This course is designed for users of Mindjet MindManager® for Windows who have some programming skills
and who want to perform additional processing on MindManager maps, or add custom features to
MindManager for Windows.

These demands often arise from using MindManager for information management, knowledge management or
project management.

1.2 Course prerequisites


Some prior knowledge will help you to get the most from this course.

1.2.1 A copy of MindManager® for Windows

You will need a copy of Mindjet MindManager® for Windows in order to follow the materials in the course.

All the examples and most of the information will apply to any version of MindManager from about
MindManager 9 onwards. A few features have been added but the basic elements of maps have changed very
little since MindManager X5.

1.2.2 A good working knowledge of MindManager

You should be very familiar with the structure and elements of MindManager maps, and with most of the
features and functions in MindManager for Windows. This course will not teach you anything about the built-in
features of MindManager.
1.2.3 Some programming skills

MindManager macros are written in WinWrap Basic (WWB), an object-oriented language compatible with
Microsoft's Visual Basic for Applications (VBA).

If you have done any kind of programming before, then WWB is easy to pick up from examples.

If you have not done any programming before, then please note that this course does not contain enough
information to learn WWB from first principles. You have two options:

· Pick up WWB as you work through these materials. There are a lot of concepts to take on board, but if
you begin by copying from examples, you can probably get a long way.
· Learn at least the fundamentals of VBA and be able to write some simple pieces of code before adding
the complexity of the MindManager Object Model into the mix. Currently there is no WWB-specific
programming tutorial, but there are plenty of tutorials on VB or VBA, which will explain the basic
constructs of the language.

1.3 Objectives
On completion of this short course, you will be able to:

1.3.1 Identify when and why to use MindManager macros

Know what macros can do, when they are an effective solution, and what the alternatives are

1.3.2 Create, debug and run simple MindManager macros


Know how to create, save, modify and run MindManager macros

1.3.3 Navigate through the MindManager Object Model

Understand the scope and concepts of the MindManager Object Model that permits MindManager to be
automated.

The MindManager Object Model is extensive with around two thousand separate artefacts. It is not practical to
try to explain and demonstrate every one of them. Instead, by learning your way around the object model and
getting an idea of how it works, you will be able to find and use further objects and methods without having
them explained in detail.

The majority of the artefacts in the Object Model are named after the English names for objects in the user
interface.

1.3.4 Create and update maps through the API

Know how to find the data you need inside maps, using the MindManager Object Model

1.3.5 Customise MindManager and deploy macros

Know how to integrate a macro into the MindManager interface to add a new command, and how to deploy
macros to other users
1.4 About your tutor

Nick Duffill
Harport Consulting
Isle of Skye, Scotland, UK

I have been working professionally with Mindjet MindManager since 1998 and contributed to the development
of the MindManager API, then created the very first exports for Microsoft PowerPoint and Microsoft Project. I
was technical editor for Wiley's "MindManager for Dummies", which is still relevant today, even though there
have been nine new versions of MindManager since! I have created dozens of commercial extension products
for MindManager, including the MindManuals product range, GyroQ, ResultsManager, Power Markers and
Network Builder, lots of things that never saw the light of day, and many hundreds of MindManager macros for
clients, products and projects.

My principle interests are the use of MindManager as a tool for business, project management and knowledge
management. I look forward to working with you and helping you discover MindManager's powerful
capabilities for processing and transforming structured information.

If you have little interest in programming, then seek out a nephew or niece who likes this stuff, and get them to
bring your ideas to life. But if you are the sort of person that thinks programming is fun, then you will find
MindManager a lot more creative than databases or spreadsheets!

1.5 How to use this map

This map is arranged clockwise in modules. In each module you can find samples, suggested exercises and
other documentation. You can also find samples and reference materials through the Map Marker index.

All support materials are linked from this map and were unpacked from the zip archive.

In the best traditions of interactive learning, please feel free to edit this map, and add your own comments and
samples.

If you accidentally destroy this map or the learning materials, just unzip it again from the zip archive.

1.6 Getting help and support


See document(s): mailto:support@harportconsulting.com

If you have a question or a problem about MindManager macros, please contact

support@harportconsulting.com
It may not always be practical to diagnose and fix detailed issues in your macro code. You can be 99.9% certain
that your code is doing exactly what you asked it to, no more and no less. There are a very small number of
known issues with the MindManager Object Model itself - it is usually very reliable and predictable.

1.7 About this map

This map is version v0.1 (Preview).

Mindjet internal training preview, not for external use. Topics with grey text are still under development at this
version.

2 Module 1: Orientation
2.1 Objectives
The objectives of this module are:

2.1.1 Understand the key components and the part they play
See also: Macros involve 5 key components

2.1.2 Know what macros can and can't do


See also: What is a macro, and what can macros do?

2.1.3 Know about alternatives to macros


See also: Add-ins are the alternative to macros

2.1.4 Know where to find reference documentation


See also: Documentation and resources

2.2 Macros involve 5 key components


2.2.1 MindManager user interface
See also: Module 2: Getting started with macros

The user interface (or "UI") is the window that appears when MindManager is launched, and contains the
ribbon tab and map editing features.

= Task Pane

A vertical window that can be shown on either the left or right of the user interface. Custom task panes can be
created and added to the UI. Task panes are a convenient alternative to pop-up dialogues for editing
specialized information, because they do not obstruct the map and do not require a command button or
keyboard shortcut to launch them. However, this means that an Add-in that uses task panes to edit custom
information must refresh when the active document and/or selection are changed.

= Ribbon
The common term for the Microsoft Fluent® User Interface used in Microsoft Office applications from Office
2007 onwards. The ribbon consists of a number of tabs, each tab being divided up into Groups containing
buttons or other controls. The state of the controls in the currently displayed ribbon is maintained by calling
update events for all controls that are currently visible, so that an Add-in can set controls to be enabled or
disabled according to the current document and selection. Add-ins can add extra command groups to the
existing MindManager ribbon tabs, but cannot directly access any commands or controls in tabs that they do
not own, so it is not possible to hijack an existing feature and repurpose it.

= Command

An object that can be executed to perform a function. A command is distinct from a button, which is
visualized. Buttons, menu items and control strip icons use commands to execute code.

Advanced tab

The macro commands do move around in different versions of MindManager. Recently, they have been in the
"Advanced" tab.

Macros command
Organize Macros...
See also: Macro Organiser

Macro Editor
See also: Macro Editor

Context menus
See also: A command in the topic context menu

Context menus are pop-up menus that are usually accessed by right-clicking on an object in the map, e.g. the
Topic context menu.

Context menus can contain commands that run MindManager macros when clicked.

2.2.2 Macro Organiser

The Macro Organiser allows you to add new commands to MindManager menus and link them to a macro than
runs when you click on the command.

You can add commands to pop-up or context menus, but not to ribbon tabs. There is (or was) a third party add-
in that will allow macros to be run from ribbon tab buttons.

We will cover the Macro Organiser in Module 9.


Macro organiser

A command in the topic context menu


2.2.3 Macro Editor
See also: Module 2: Getting started with macros
The Macro Editor (sometimes called an IDE or Integrated Development Environment) allows you to create,
save, test and run macros.

The Macro Editor is introduced in Module 2.

Macro Editor
2.2.4 WWB programming language
See also: Module 3: Programming with WWB

WinWrap Basic, the programming language for macros is "VBA compatible", which means it uses the same
form of Basic as Microsoft's Visual Basic for Applications.

In comparison to Microsoft Office macros, WWB has limited features for designing forms or dialogues. Native
forms tend to look like Windows 98 or thereabouts, and some kinds of control are not supported.

WWB accesses MindManager by reading and writing properties and calling the methods of the MindManager
Object Model.
Programming in WWB
2.2.5 MindManager Object Model
See also: Module 4: The MindManager Object Model

The MindManager Object Model defines the way that MindManager functions and maps are structured. For
example, the Object Model defines the data that is held in a map, the data held by each topic, and the way that
the topics relate to each other to build up a map.

Being able to find your way around the Object Model is essential.

We will cover the Object Model in module 4.


Object Model Browser
2.3 What is a macro, and what can macros do?
2.3.1 Macros are custom programmes that run within MindManager

MindManager macros are small custom-written programmes that run within the MindManager environment.
They cannot run outside of MindManager, so never appear in the Windows start menu. However, they can still
be separately installed like regular software.

When running, macros have direct access to many parts of the MindManager internals, and to the data inside
maps that are loaded into MindManager. When a map is opened in MindManager, a macro can read any and
all content if the map is not password-protected.

MindManager macros have a simple programming language that will be familiar to anyone who has developed
macros for Microsoft Office products. They are quick to write and debug.

2.3.2 MacroMindManager Macros have multiple uses


MindManager macros are ideal for:
· Creating one-time solutions for special situations. It is often quicker to write a macro to do something
1000 times than to sit and click for hours.
· Creating special imports and exports.
· Processing information in the map, e.g. processing the contents of a document.
· Extending MindManager's functionality, so that it can do things that are not part of the standard
toolset.
· Working with trusted users by providing special tools that support the way that your organisation is
using MindManager.
· Building prototypes and proving concepts before investing in more sophisticated development.
· Learning the MindManager Object Model.
2.3.3 Macros have limitations
· Macros do not provide a "recording" feature like some other applications. You cannot teach
MindManager to repeat a series of operations by recording them in a macro.
· Macros do not provide a simple way to execute built-in MindManager functions and features. It is
possible to access certain commands, but the API can only tell you when topics, relationships or
boundaries are selected. It does not know when you have selected a specific icon, map marker or other
artefacts outside the map.
· Macros do not have sophisticated forms and controls. The native forms are rather dated in appearance
and only basic controls are available.
· WinWrap's WWB-NET variant (support for .Net) is not implemented in MindManager.
· Macros do not run particularly quickly, as they are interpreted on demand and not compiled into
executable code. Heavy data processing will run slowly in macros.
· Macro code is plain text, so is readable by anyone. This makes it unsuitable for deployment where you
need to protect the source code.
· The objects handled by a macro are only in scope while the macro is running. When the macro exits, all
object go out of scope. This means that you cannot use macros to create persistent objects such as
ribbon tabs and ribbon commands or task panes. Also, a macro must be running to respond to events
from MindManager. This sets limitations on the types of event that are reasonable to handle.
· Only one macro can be running at any time.
2.3.4 You can damage your maps with macros!

It is perfectly possible to damage your maps with a rogue macro. If a macro causes MindManager to crash
(which is unlikely, but can happen) then you risk losing some content. Or, a macro might make an incorrect
change that you did not notice or check, and you then save the map.

When using unproven or untrusted macros on real maps, always work on a copy of your map.

It is unlikely (though not impossible) that macros could also affect your system. Like any programming, if your
macros write to the system registry, or create, delete or rename files, then there is no limit on what could
potentially go wrong. Test them carefully under controlled conditions before letting them loose on a live
system.

2.4 Add-ins are the alternative to macros

If you need to create a custom function for MindManager, or process maps in a special way, the choices are:

· Use macros for speed and simplicity unless it is something that a macro cannot do
· If you need any of the following, create a MindManager Add-in instead:
· Good performance at scale
· Custom ribbon tabs or task panes
· Always-on response to events from MindManager
· Use of Microsoft .Net technologies
· Sophisticated forms and controls
· Consistent look and feel with MindManager
= Add-in

A registered DLL that exposes the Microsoft Office IDTExtensibility2 interface, which allows MindManager to
connect to it and disconnect from it. Add-ins can then register themselves as an event listener, and receive
events that relate to changes in the map or actions in the UI (such as clicking a button that is owned by the
Add-in). Add-ins usually add new commands, task panes and other functionality to MindManager. They exit
when the MindManager.exe process quits, and do not have an independent process or UI outside of
MindManager.

You might also like