Open Word Doc on Mac

I had in in past but can’t give details. I just remembered that strange behaviour where an app did not like an alias object but a direct path, only.

Well, if it wanted a real path as a string, then it didn’t want a file reference. But then it just wanted a string, in form of a POSIX path or HFS path. Then you’d not use “file” or “posix file” as a qualifier before the path, either. But in my example above I was talking about the “open” command, which ALWAYS wants a file ref, which you can specify with the “file” or “posix file” or “alias” type qualifier, but never as a plain string that contains a path. It’s a different type. App may support their own custom commands, and if the programmer didn’t know how to handle file refs in AppleEvents, then he might have chosen the cheap way of expecting a plain string, but that’s just a bad design of their app, not a general rule, then.

If you want to know if a file is a Microsoft WORD file, before attempting to load it… you can simply check the first few bytes

if would be a .DOCX if it is any of these 3 sequences

or a .DOC if it is this

source : List of file signatures - Wikipedia

Interesting tidbit Dave but I am distributing the Word doc with my app. So I know it needs Word. I just don’t want other apps to open it. I only want Word to open it.

Why not use PDF you ask? Because I want them to be able to customize it with their own logo… delete rows that aren’t applicable etc.

Anyway all I want to do is know “is Word installed and if so open it in Word and only Word”

You could also check to see if they have Apple Pages installed. It can open most Word files without issues.