\input luaotfload.sty
\font\pt = file:pala.ttf at 14pt
%\documentclass[12pt]{article}
%\usepackage{fontspec}\setmainfont{Palatino Linotype}
%\newwrite\luadebug
%\immediate\openout\luadebug luadebug.lua
%\AtEndDocument{\immediate\closeout\luadebug}
%\def\directluadebug{\immediate\write\luadebug}

\directlua{dofile("lgr2utf.lua")}

%\newcommand{\cbgreek}[1]{%
\def\cbgreek#1{%
  \catcode`<=11 \catcode`>=11 \catcode`~=11%
%  \scantokens{%
%  #1
%  }%
%  \scantokens{%
    \directlua{lgr2utf("\luatexluaescapestring{#1}")}%
%    \directlua{lgr2utf(#1)}%
%  }%
%  \scantokens{\directlua{lgr2utf(#1)}}%
  }

%\begin{document}
\pt

Aristotle begins the {\it Topics} saying: \cbgreek{<H m`en pr'ojesic t~hc pragmate'iac m'ejodon 
e<ure~in >af'' >~hc dunhs'omeja sullog'izesjai per`i pant`oc to~u protej'entos probl'hmatos >ex >end'oxwon}.%
\footnote*
{By contrast, the {\it Analytics} begins stating: \cbgreek{Pr~wton e>ipe~in per`i t'i ka`i t'inoc >est`in <h sk'evic, <'oti per`i >ap'odeixin ka`i >epist'hmhc >apodeiktik~hc}.}

%\end{document}
\bye
