This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We do this with Pages because it's the only thing that can correctly convert rtfd. | |
# textutil works on rtf files with no text in them but not on rtfd. | |
set my_paths to {"/path/to/first/file.rtfd", "/path/to/second/file.rtfd"} | |
repeat with my_path in my_paths | |
tell application "Pages" | |
set my_file to (my_path as POSIX file) | |
set my_name to name of (info for my_file) | |
set doc to open my_file | |
export doc as Microsoft Word to alias (my_path & ".docx" as POSIX file) |