Le 05/08/2015 à 17:04, William Adams < email@hidden> a écrit :
On Aug 4, 2015, at 7:54 PM, Shane Stanley wrote: OS X defines NSMacOSRomanStringEncoding as 30, so it sounds like they are using the standard OS values:
Thank you. I've tried a bunch of those options, and also options for changing the line endings, but didn't have any luck. I need to save the files out as: Other Encoding: Western Windows (Latin 1) w/ CR LF line endings, but nothing I've tried here has worked: on open of theFiles repeat with x in theFiles tell application "Microsoft Word" open x save as the front document file name path of the front document & ".txt" file format format text text encoding 5 line ending type line ending cr lf close front document saving no end tell end repeat end open What is the secret trick to making this work? I'm not getting any error messages or feedback in the system.
Before trying to do the job in a loop, it would be useful to try to understand what is really happening in a single treatment like :
set x to "path:to:a:word:document.doc" as alias
tell application "Microsoft Word" set docX to open x save as docX file name (path of docX & "1.txt") file format format text log result log 1 save as docX file name (path of docX & "2.txt") file format format text line ending type line ending cr lf log result log 2 save as docX file name (path of docX & "3.txt") file format format text text encoding 30 line ending type line ending cr lf log result log 3 save as docX file name (path of docX & "4.txt") file format format text text encoding 5 line ending type line ending cr lf log result log 4 close docX saving no end tell
With this simple code, if there is no reported error, you will be able to compare the different files created.
I hope that the added parenthesis may help the script to execute your instructions. OK, you receive no feedback but is the code creating a file or is is just skipping thje instruction ?
On my side I can't test because Microsoft products aren't allowed to enter my home (and of course my mac).
Yvan KOENIG running Yosemite 10.10.4 in French (VALLAURIS, France) mercredi 5 août 2015 19:13:19
|