OSX: Raise Textadept on startup

When Textadept is started from the command line (i.e. using ta or your own script) in OSX, the Textadept window will not be the frontmost. To raise it to the front, include the following code in your .textadept/init.lua:

if OSX then
    cmd='osascript -l JavaScript -e \'Application("System Events").processes["textadept"].frontmost=true\''
   f=io.popen(cmd)
   f:read()
end

Edited on Thursday, April 26th 2018 at 7:48 AM.