I exploit a bash script (myJavaBash.sh) inside an Software Bundle (myJavaJar.app), that begins “java -jar myJarFile.jar” with further JVM arguments (which works nice thus far). My purpose is to go a file identify as argument to the applying, too, at any time when the person opens a file through “open with … myJavaJar.app”.
I attempted to implement OpenFilesHandler within the java utility and to repeat an AppleScript-scpt-file into the bundle that calls myJavaBash.sh with out success.
Final thing I attempted only for the sake of testing each risk was to name osascript inside the bash
#!/bin/bash
#take a look at: set command line args
MY_TITLE="Launching myJavaJarApp"
ARGS_MSG="command line args: "
osascript <<-EndOfScript
set arguments to ""
on open theFiles
repeat with anItem in theFiles
set arguments to arguments & house & (quoted type of POSIX path of anItem)
finish repeat
finish open
show dialog "$ARGS_MSG" & arguments with title "$MY_TITLE"
EndOfScript
Didn’t work out, the dialog simply states $ARGS_MSG an no arguments, after I open a file with the myJavaJar.app.
Appears to me that setting the bash-script as CFBundleExecutable “consumes” all AppleEvents.
Or is there a method?