Hi,
I am getting errors with the action = Read File to Variable
In my case, I manually created from a blank document a simple Microsoft word file with just a few lines of text and saved as test.docx
Also, I manually created a similar document with Apple Pages app and had the same problem = test.pages
Same with test.doc file
I'm doing nothing unique as far as text encoding = just basic Apple defaults.
Then in KM, I created a simple action:
Read File to Variable
Read file ~/Desktop/test/test.docx
or
Read file ~/Desktop/test/test.doc
or
Read file ~/Desktop/test/test.pages
To variable MyContent
And I got the error for each attempt:
Read File action failed to read text file with error Error Domain=NSCocoaErrorDomain Code=264 "The file “test.docx” couldn’t be opened because the text encoding of its contents can’t be determined." UserInfo={NSFilePath=/Users/xxx/Desktop/test/test.docx} in macro “msword1” (while executing Read File to Variable “MyContent”).
BTW: The read file action has no problem with xxx.txt files - only .docx and .doc and .pages documents
My bigger goal is to be able to read hundreds of previously created Microsoft word files and do additional actions after reading the file.
--> Q: is there some way to get around this text encoding error issue?
I imagine if I had to, I could create another KM macro to loop and open and save all as plain text - but that sounds like a cumbersome solution.
Here is an associated thread:
Thanks for any help - Dave