[Deleted private e-mail response...]
John sent me a copy of his plug-in and I've just had a chance to look at it.
The problem was that his LibraryMenuItem.lua file was encoded as UTF-8 and had the UTF-8 byte-order-mark (EF BB BF) at the start of the file.
Though Lightroom's APIs are expressed in terms of UTF-8, that is a choice made by the Lightroom team. Lua itself has no knowledge of UTF-8 and doesn't know what to do with these odd bytes at the start of the file.
Solution: Re-save the file as plain ol' ASCII.
Well spotted Eric.I've now isolated the problem to using the most recent version of ExtendScript ToolKit on the Mac and not noticing ESTK3's new preference for the UTF-8 signature. Its default is "Always write signature" which does exactly what it says on the tin - saving the file with the default preference results in the error, switching it to "Never" resolves it.
The Mac-PC thing is not a case of LR handling UTF-8 encoded files differently on different OS's. It's simply the result of initially writing the plug-in an earlier version of ETSK which doesn't have this preference.
Thanks for your help