In addition to Ian's suggestions, you can also set up different
profile scripts each with its own config directory. This way the
sessions can be distinguished by color, position, J version etc. This
also helps with different applications.

On Thu, Apr 23, 2020 at 3:39 AM Ian Clark <earthspo...@gmail.com> wrote:
>
> Just tried it with j901 under Catalina -- it works.
>
> To make a jscript determine which jqt session it's running in: get the pid
> using: 2!:6'' .
> pid numbers ascend in value, so the latest jqt session launched will have
> the highest pid.
> Write the pid out as a textfile in (say) ~temp. The file will show the pid
> of the latest jqt launched, and you can compare it with 2!:6'' .
>
> I said you could also duplicate bin/jqt.command --> bin/jqt2.command.
> That's not enough: you must also duplicate bin/jqt --> bin/jqt2
> …And edit the duplicates (drop onto TextEdit in Dock) to make them point to
> each other. Then ARGV will show <'bin/jqt2' .
>
> On Thu, 23 Apr 2020 at 03:13, Ian Clark <earthspo...@gmail.com> wrote:
>
> > A more "maccy" way to do it (e.g. for jqt) is simply to duplicate jqt.app
> > and rename the copy to jqt2.app.
> >
> > This is more attractive to a competent Mac user, who doesn't care to
> > become an expert in the guts of J.
> > It will also work with any app file, though some of them are large (Xcode
> > runs to gigabytes).
> >  jqt.app is only 83K, it's nothing but a wrapper to
> > launch /Applications/j64-807/bin/jqt.command
> >
> > I've just reminded myself of the steps, using j807 under El Capitan, and
> > they are as follows:
> >
> > 1. Locate jqt.app -- left-click the green J in the Dock and choose:
> > Options > Show in Finder
> >
> > 2. File > Duplicate it, to give jqt copy.app. Rename it: jqt2.app
> >
> > 3. Drag jqt2.app into the Dock and you have two green Js, which behave
> > like independent apps.
> >
> > HOWEVER there are gotchas…
> >
> > They both use the same *-user folder, and exactly overlay each others'
> > Term and Edit windows. Drag the top window away to see the one underneath
> > -- or click the green J in the Dock that you want. Color the windows
> > differently to distinguish them.
> >
> > It's a challenge to distinguish programmatically which of jqt, jqt2, is
> > actually running a given script. ARGV is no good: it gives  <'bin/jqt' for
> > both. You could of course duplicate bin/jqt.command --> bin/jqt2.command
> > and point jqt2.app at it, but that requires brain-surgery on jqt2.app (not
> > hard, but a bit fiddly, and some knowledge of shell-scripting is required).
> > My old solution, if memory serves, was to find the pid (process ID) of the
> > given session in config/startup.ijs and write it into PID_z_. It's several
> > years since I routinely ran second copies of J, so I'll have to ferret out
> > the details if your client is keen to know.
> >
> > I haven't tried doing it with j901 under Catalina. I'd anticipate
> > Gatekeeper or permissions problems, since Catalina is stiff with booby
> > traps for hackers. But the above might still be made to work.
> >
> > On Thu, 23 Apr 2020 at 00:48, chris burke <cbu...@jsoftware.com> wrote:
> >
> >> In macos, clicking a desktop icon for an app that is already running
> >> just gives it focus.
> >>
> >> However, you can load multiple copies of J from the command line, i.e.
> >> something like
> >>
> >>   ~/j901/bin/jqt.command
> >>
> >> Equivalently, browse to the J bin folder in Finder and double click
> >> jqt.command.
> >>
> >> On Wed, Apr 22, 2020 at 4:13 PM Henry Rich <henryhr...@gmail.com> wrote:
> >> >
> >> > How do you start two J sessions on a Mac?  My client tells me that when
> >> > they click the J icon they get a J session, but when they do it again
> >> > they get nothing.
> >> >
> >> > Henry Rich
> >> >
> >> > --
> >> > This email has been checked for viruses by AVG.
> >> > https://www.avg.com
> >> >
> >> > ----------------------------------------------------------------------
> >> > For information about J forums see http://www.jsoftware.com/forums.htm
> >> ----------------------------------------------------------------------
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >>
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to