XXXX Macro (v11.0.2)

I am trying to open a file that I have named using a variable that includes a date token. The file is correctly created and named and can be opened manually. But, I cannot get the macro to open the file. Any suggestions would be greatly appreciated. This is what I have done so far:

XXXX Macro (v11.0.2)

XXXX.kmmacros (4.9 KB)

Hi, and welcome to the forum!

I do not know if you have a global variable named “File” in your Keyboard Maestro, or what it may be set to, but I suspect it is here, within your last action, the problem lies.

In the text input field to the right of 'open', in your Open a File action, Keyboard Maestro is expecting to be pointed towards a complete path to the file or folder you want to open.

Below is a version of your macro where I have done a few alterations:

•I've added a couple of green Set Variable to Text actions at the top.

•Into the first of these you need to add the path to the folder where to Safari exported your PDF. The easiest way to obtain this path is to right click on the folder in question, then pressing option and clicking Copy "Your Folder Name" as Pathname. Then paste this path into the first green action in the macro below, the one with variable name "local_folderPath". (If Safari exported your PDF to your "Documents" folder, the copied path should look something like "/Users/YourUserName/Documents")

•Into the second green Set Variable to Text action, the one with variable name "local_fileName", I've added your chosen filename format.

•The first orange action I've set up to paste the file name from the "local_fileName" variable

•The last orange action I've set up to open your file based on the folder path inserted by the "local_folderPath" variable, followed by a "/", followed by the file name inserted by the "local_fileName" variable, followed by ".pdf", as in: %Variable%local_folderPath%/%Variable%local_fileName%.pdf

XXXX.kmmacros (6.4 KB)

Hope this makes sense and you get it to work! If not, do not hesitate to ask or clarify further



Thank you so much!
I actually got it to Work and learned a lot in the process.
This is what I ended uo with:

Thanks again,


1 Like