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 Think.md /Users/will/Dropbox/zettelkasten//201912140845 Birth Lottery.md /Users/will/Dropbox/zettelkasten//201912151753 Ignore reality.md /Users/will/Dropbox/zettelkasten//201912151757 Yearning for specificity.md /Users/will/Dropbox/zettelkasten//201912151806 Personal action.md /Users/will/Dropbox/zettelkasten//201912161141 Hearing is like the wind.md /Users/will/Dropbox/zettelkasten//★ Tag Cloud.md

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)

Clarification.

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.

Replace

with:

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

2 Likes

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