I have a footer for my journals that grabs photos, documents, etc that have text in the name that matches either the current filename, or the aliases of the current file:
To match the aliases, you can see I have it hard-coded to check the first three in the array. This works, but if a note has four aliases, it won’t check the forth. How would I change this so it looks at ALL the array elements (it varies from 0 to unknown) instead of just the first three?
No, guess I should have provided a little more context. An example filename would start with a date string, followed by a string (eg. “20240214 - Dave.jpg”). So on a file named “David.md” with an alias of “Dave” I’d want the link to “20240214 - Dave.jpg” to show up. Flipping it around would only work if the full filename were in the alias.
As usual, you rock! That works, much cleaner code than I had in a number of different footers, and now I don’t need to be as concerned about how many aliases I have and what order they are in. Thanks again!