How to open a written from clipboard file if filename contains date/time stamp with seconds?


Basically I wrote a macro which copies a text to the clipboard and passes it through a series of BBEdit Text Factories which all work fine.

At the end of the macro (show in the ScreenCapture) I write the clipboard to a file which all works flawlessly.

I have a problem with the last step: I want to open that file in Typinator (it works fine with dummy files, Typinator imports it as a Set with abbreviations and expansions which is what I want).

My problem is that I don't know how to write the filename of the file that I want to open in Typinator because the filename in the Write System Clipboard to File Action contains a date time stamp including seconds.

thank you for your time and help

Write the file path (including the time stamp) to a variable, then use that variable to write the file and to open the file. Like this:



great idea, once again !! thanks very much Tom

Tom, is there any way that I could add an actin to edit the clipboard to make a few minor corrections instead of editing the actual file later in the macro ? thank you

regex search and replace on the clipboard? There's an action titled something like that.

1 Like

I would like to look and edit myself visually. It's a simple question of deleting a comma here, adding a tab there. I would be working on the final product after multiple regex. By the way, I personally prefer using the BBEdit Text Factory action rather than the regex search and replace on the clipboard.
thank you for your comment.

You could put it in a named clipboard, rather than the system clipboard. Named clipboards can be directly accessed from the keyboard maestro editor preferences

1 Like

thank you. I will try and get back to you

Basically you could just paste your clipboard to any open window of any text editor, edit the text, and copy it again.

Here is a little macro that helps you to do this super-quick:

Quickly Edit Clipboard Text.kmmacros (4.0 KB)


  1. Have some text on your clipboard.
  2. Press F1
    • A new TextEdit window with your clipboard text will be opened.
  3. Edit your text there (no need to save the document).
  4. Press F1 again.
    • The window will close and the edited text is on your clipboard.

There is nothing wrong with your preference, but I'm curious. Why do you prefer BBEdit Text Factory?


because I can use their native ready to eat text filters, and because I had some regex which worked with BBEdit and did not with KBM (slight differences in regex I think).

it works perfectly. Just changed Textedit to BBEdit. thanks very much Tom. Greatly appreciated.