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
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?
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).
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.
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.
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
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.
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.
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.