Using KBM to ping pong between 2 apps: an outliner and a mindmap

Hello,

I have a problem with specific apps, but it should interest forum members who regularly have to ping pong files between 2 apps.

I often work in 2 apps:

  • one is an outline app, the excellent OmniOutliner Pro

  • the other is a Mind Mapping app called Simple Mind Pro which makes complex outlines much easier to read and to use as decision trees.

See example below.

I would like to create a macro which would allow me to automate the tedious process of constantly exporting importing, etc as per the following:
Outline app ➤ create outline ➤ save outline ➤ export outline as .opml ➤ close outline ➤ open MindMapping app ➤ import .opml outline ➤ make any changes ➤ save, export as .opml and close ➤ reopen in outliner etc

thanks very much for your time and help

What have you tried, and what were the results? (When asking for help, you should always specify your goal, what you’ve done, what resulted, and how this differed from your goal.)

Does it work with other apps, but not work as expected with the two apps you mention?

—Kirby.

2 Likes

And, in particular, which are the bits you’re finding difficult?

The exporting?

The importing?

The switching between apps?

1 Like

I would start by writing four “base” macros:

a. MindMapping app ➤ import outline
b. Outline app ➤ import outline
c. MindMapping app ➤ save, export and close
d. Outline app ➤ save, export and close

Then you write two “super” macros to execute the base macros in the desired combination. Probably:

A. Execute macros d & a
B. Execute macros c & b

This approach has the advantage that you can use the base macros also as standalone macros. For example:

  • In the morning you’ll have nothing to export, you just want to open the file, so you launch just base macro a.
  • Later — when you have to ping-pong — you launch super macro B, then A, then B, etc.
  • At the end of your session you launch base macro c (or d).
3 Likes

@Tom @MartinPacker @Kirby_Krieger

Hello Tom Kirby and Martin,

Kirby and Martin: I understand your points. I asked the question because I did not know where to start.

Thank you very much Tom ! I will follow your blueprint and report back when I get into the inevitable snags

2 Likes

@Tom @MartinPacker @Kirby_Krieger

I followed Tom's outline and have made some progress. I hit 2 stumbling blocks: I have to export to a different directory and have to specify replace IF I am asked save? replace?

Cfriend kindly explained how to save and replace with a new version, but I am confused as to how to use it in the context of this macro.

thanks very much

I think you want the space key if the button you’re pointing at is the one you want to press.

1 Like

thank you for your answer.
The problem is that sometimes it will be save only , other times replace (if there is a file of the same name).

Ronald, have a look at what you just said: "if there is a file of the same name"

Apparently you have already detected that there is an if condition involved. So why not use an "If…Then" action?

…like for example:

2 Likes

thank you. I will try it.
I very much appreciate your help and patience.

If it doesn't work as you expected then adjust the timing. For example, with that "If…Then" action you have to make sure that the dialog box with the Replace button is on-screen when the action runs.

If it isn't then throw in a Pause action of, maybe, 0.5s. How much pause you need (if any) depends on the program and on your computer, so you have to figure this out by trial and error.

Also keep in mind that when your computer is under heavy load the program may react more slowly.

2 Likes

So, the ‘otherwise’ ie the else can be left blank (0 action) because if there is no file with the same name, the export will go ahead seamlessly.
Is that correct ?
thanks

Without too much thinking, I would say Yes. Go ahead and try it :wink:

But, as said, if it doesn’t work then pause the macro a bit, so that the dialog has a chance to appear before the macro finishes.

Just in case:

The fact that you are posing such cautious questions as the last one — I mean, a simple test would have answered your question — gives me the impression that you are testing your macro on real data.

Don’t do that! Create a temporary folder, copy-drag some test files into that folder and use that folder and the contained file copies to test your macro with.

GUI scripting involves a lot of trial and error. Don’ t use your actual files for that!

Only when you are sure that the macro really does what you want, replace the folder path of your temporary folder with the one of your real folder.

2 Likes

OK. thanks very much !

Best way is to create a temporary folder (name it Tmp or _Tmp or whatever) at the root of your Home directory. That way it is outside of iCloud Documents Sync, but, besides that, the system (and KM) will treat it just as any other folder in your Home directory.

Then, for testing macros, scripts, etc. just copy-drag the whole folder hierarchy of one of your real data folders into that Tmp folder. That way you can test your stuff on a perfect clone of the file/folder tree, and all you need to do, once the macro is finished, is to change the root directory variable in the macro. (From Tmp to the directory where your real files are located).

For additional convenience set up Hazel so that it cleanse that Tmp folder. For example make it remove any file that has not been opened in the last two weeks and delete any empty folder that hasn’t been touched in the last two days. Or so.

1 Like

thanks very much. Will do.

If you’re specifying the destination of the save, then you can pre-trash (using an action of course) the destination before saving to avoid the necessity of replacing.

1 Like