(2!:0) 'open -na jqt.app'
…will open a second JQT session as if it were the most natural thing in the world. (Something similar is possible in Windows, apparently.)
So that gets me half-way to a keyboard shortcut that will not only launch a new JQT session but open the Viewer. All I need is a way to load the script:
'~addons/gottsman63/jwikiviz/run.ijs’
…as part of the “open” command. (Obviously I can convert the ~ with jpath as part of the shortcut line.)
I’ve searched and experimented without success. I actually asked ChatGPT* for a solution. It provided four plausible-looking candidates, the closest of which was:
If you're using the macOS Terminal to launch JQT, you can specify the script file directly as a command-line argument when launching the application. This approach is similar to using the open
command with an argument for the file to open. Here’s how you can do it:
Navigate to the location of the JQT application in Terminal. It might be in your /Applications
directory if installed normally.
Use the open
command with the -a
option (specify application) and provide the path to the .ijs
file you want to load:
bashopen -na /Applications/jqt.app --args path/to/your/script.ijs
Replace path/to/your/script.ijs
with the actual path to your .ijs
file.
So I tried:
(2!:0) 'open -na jqt.app --args /applications/j9.5/addons/gottsman63/jwikiviz/run.ijs'
…which launched JQT but did not load the Viewer. I’ve occasionally found ChatGPT capable of hallucinating a perfect-looking solution to my problem—perhaps that’s what happened here.
Any help would be greatly appreciated.
Many thanks.
Ed
*I’ve found that for Python and JavaScript, ChatGPT is excellent at dealing with questions that begin, “This ought to be possible, I just can’t work out the syntax…” I’ve also found that it’s confident-but-hopeless when it comes to J, a commentary perhaps on how far outside the mainstream J finds itself (to quote Maxwell Smart: “And…loving it.”).
Devon McCormick, CFA
Quantitative Consultant
not found: C:/Users/edwar/-ijix
|file name error in script, executing monad 0!:0
|nonexistent file or invalid filename
| 0!:0 y[4!:55<'y'
|[-134] C:\Program Files\J9.5\system\util\boot.ijs
not found: C:/Users/edwar/-ijix
|file name error in script, executing monad 0!:0
|nonexistent file or invalid filename
| 0!:0 y[4!:55<'y'
|[-134] C:\Program Files\J9.5\system\util\boot.ijs
As does the command:
“C:\Program Files\J9.5\bin\jqt.exe” -ijix “C:/program files/j9.5/addons/gottsman63/jwikiviz/run.ijs"
I’ve tried several other variations of these commands without success.
Any idea what I might be doing wrong?
Thanks again.
Ed