I desperately want to open a new instance of MacVim by clicking on its icon in the dock such that it opens a wildcard list of files from my OneDrive directory.
One tip was to use Automator to run a bash shell script, with something like:
open -a MacVim.app -n --args --cmd "cd $HOME/OneDrive/Notes" journal-*
The problem with this approach is that the shell translates "*" in the context of open's current working directory. However, if I try :
cd $HOME/OneDrive/Notes && open -a MacVim.app -n --args --cmd "cd $HOME/OneDrive/Notes" journal-*
this also fails to work as expected. The filenames are expanded properly, but
open switches back to the home directory when launching MacVim, so that it tries to open the filenames in the home directory. This seems to run in contradiction to the manual page which states that the app inherits all the environmental settings. Apparently it doesn't really mean that.
What is trivial in Linux and Windows seems monumentally challenging in OSX. Surely there is a simple solution here?
Yet another solution involves xargs and find, but the versions in MacOS are rather archaic (by GNU/Linux standards).