I am going to run file -I to check the encode type of a text file.
If I run it in terminal:
Admins-iMac:~ admin$ file -I /Users/admin/Documents/systemtools/Best\ VPN\ in\ 2019\ list.txt
/Users/admin/Documents/systemtools/Best VPN in 2019 list.txt: text/plain; charset=us-ascii
Note the encode type is us-ascii. It works.
It's easy to build this KMM(acro).
Please see the file A in attachment. It's the first version KMM. But I find that if the filename contains space, the KMM will report error. So I use a 'search and replace with regex' macro to escape the space with "\ " in file name(or path).
the original file path is(you can create a txt file for testing):
/Users/admin/Documents/systemtools/Best VPN in 2019 list.txt
the edited file path is:
/Users/admin/Documents/systemtools/Best\ VPN\ in\ 2019\ list.txt
Please see the file C in attachment. I put this new path in single execute a shell script macro, it works OK. But Please see the file B in attachment.
I put the new edited path in a variable called path, then send the path to the macron via $KMVAR‗path, it doesn't work.
Hope someone can tell me what's wrong with KMM B.