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).
for example:
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.
A nH check encode type of text file v0_Backup_20200321_1526_v0.kmmacros (9.4 KB) B nH check encode type of text file v0.kmmacros (3.1 KB) C nH check encode type of text file v0.kmmacros (2.9 KB)