Extracting file paths and adding them

Hi there,
this is my first posting, let me already apologize if it is awkward. :slight_smile:

I've been using keyboard maestro for several days now and I've created already a bunch of macros. I cannot imagine living without it anymore. :smiley:

But right now I'm stuck.

I use XMIND ZEN and I want to export an XMIND-File to a PDF and Word-File with one click. It all works well within XMIND (well almost as you can see). I can get the export PDF and the export Word to the Desktop without a problem.

But XMIND doesn't export it into the right path where the document was originally stored.

Which means I do need the Finder information.

So this would require starting the macro by highlighting the XMIND-File in Finder.
Start XMIND, have the macros do their job and add the file path to the file name.

But I don't know how to extract the file path from the Finder and neither do I manage to open it at all (some things come easier for me than others, apologies for asking such a - probably stupid - question.)

And neither do I know how to add the file path to the output.

Thanks for all your help.


As a starting point, and then you can clarify exactly which parts you are having any further problems with.

Thanks so much!
I was looking in the forum, but couldn't find anything that seemed to work!
I'll look into it!

Best! Alex!

This may not be exactly what you need, but maybe it will give you some ideas:
ACTIONS: Extract Relative File Path

1 Like

Thanks so much! I'll check it out!

1 Like

Hey Pen,

XMind ZEN isn't scriptable, and its accessibility features are poor – so you can't even get the file of the front document. The dev(s) should be ashamed...

Even so – it's possible to get this critter with Spotlight.

Although there's a risk of more than one file being found, I've mitigated that by using the kMDItemLastUsedDate attribute in addition to the kMDItemFSName attribute.

Find File of Front XMind ZEN Document.kmmacros (5.4 KB)

Once you have the disk location of the document it's not hard to navigate there in the save dialog.


Wow, ccstone! You are amazing. Thanks so much! I will try it out next week when I'm back at work. Thanks!