Open a file that I double-click with app created with Script Editor
Going off the answer you provided:

on open fileName
        do shell script "PATH=/Library/TeX/texbin:$PATH ¬
            open -n -a /Applications/Xournal++.app " &amp; ¬
            quoted form of POSIX path of fileName
end open


a simpler solution would have been:

on open {fileName}
        tell application "Xournal++" to open (fileName as «class furl»)
end open


which will work for even non-scriptable applications that accept high level Apple events.  For those that don't, then:

on open {fileName}
        tell application id "com.apple.Finder" to open fileName ¬
                using application file "/Applications/Xournal++.app"
end open


However, overall, it's curious where you're going through the effort of passing it a file to open, only to have it open the file in some other application.  This is a bit like mounting a mirror on the wall to look at your monitor while using the computer, unless this is actually just a small extract from a larger script.