Concatenating file names to a variable

I plan a macro that takes today's newly modified files from a specific directory and presents them as a variable the can be pasted into a journal.

The hard part, which I'm working on first, is the regex reformation of the results of --

find ~/Dropbox/zettelkasten/*.md -type f -mtime -1

Which today is --

/Users/will/Dropbox/zettelkasten//201911232037 Going Away to /Users/will/Dropbox/zettelkasten//201912140845 Birth /Users/will/Dropbox/zettelkasten//201912151753 Ignore /Users/will/Dropbox/zettelkasten//201912151757 Yearning for /Users/will/Dropbox/zettelkasten//201912151806 Personal /Users/will/Dropbox/zettelkasten//201912161141 Hearing is like the /Users/will/Dropbox/zettelkasten//★ Tag

I got a regex that works capturing the date and title of each file (probably could be optimized). The regex ignores the last line as it doesn't have a date and this is as planned. That part is done.

Using the pictured macro - I can't seem to get more than one file to populate the %noteNames% variable. What am I doing wrong?

File Name - Date.kmmacros (2.9 KB)


I can get the macro to read one line of the text but not all of them. Why is this stopping after processing the first line?

This macro is not finished or even near. I'd like to get past this before adding the command line argument and output to %System Clipboard%

You are overwriting the "noteNames" loop variable with your "Set Variable to" Action.



You should also "Set Variable newNoteNames" to "" at the top of your macro.


Thanks for you tutoring, On initializing a variable and where to find "append to a variable". This made all the difference. Now I can move on.

1 Like