It seems to me that you could use an operating system script (a .bat
file, for example) to perform a number of these steps in sequence. Or,
if that is outside your comfort level, a sequence of shortcuts on your
desktop might work for you.

Or, for the "shutdown" thing, maybe take advantage of how setting are
different for running on battery vs. plugged in. (Don't shut down when
plugged in, shut down after a relatively short time - and with a dim
screen until then - when running on battery.) This assumes your
computer has a battery, though... otherwise, I guess maybe go with the
desktop shortcuts approach (which should be doable, though I've not
researched that myself).

Another thing is that when you launch j (from a script, or shortcut)
you can specify a j script for it to run (that's what happens when you
launch jhs). So you should be able to take advantage of that, here -
write a script to load up your stuff, and then drop into jhs, rather
than loading up jhs and then using the browser to have jhs load up
your stuff.

For example, it might go like this:

click on the link to set your power down preferences.

click on the link which runs the .bat file to start up your jhs app(see below)

......

click on the link to revert your power down preferences

actually, why don't you just manually power down your machine when you
are done? That will shut down jhs, also...

Meanwhile, the .bat file to start your jhs app would look something like this:

start path-start-jhs-server
sleep 3
start http://127.0.0.1:65001/locale

Or, if you are running OSX, replace 'start' with 'open' and make this
a shell script rather than a .bat file. (No extension on the file
name, first line is #!/bin/sh and chmod +x filename before running
it.)

Actually, if I recall correctly, I think you will be using OSX, so...
for the jhs side, you could do

open /Applications/j64-805/jhs.app

but instead, you probably want to take the script at
/Applications/j64-804/jhs.app/Contents/MacOS/apprun which will look
something like this:

#!/bin/sh
open -a /Applications/Utilities/Terminal.app "`dirname
"$0"`/../../../bin/jhs.command"

which basically just runs /Applications/j64-805/bin/jhs.command

which looks something like

#!/bin/sh
"`dirname "$0"`/jconsole" ~addons/ide/jhs/core.ijs -js " init_jhs_'' "

# see ~addons/ide/jhs/config/jhs_default.ijs for config info

(the dirname stuff is so that the J application can be installed
anywhere - this finds stuff relative to where that particular file is
stored.)

So you can simplify that to:

#!/bin/sh
/Applications/j64-805/bin/jconsole '~user/startserver.ijs' -js 'startcommand 0'

replacing the "start" stuff with whatever works for you (and maybe
using double quotes if you do not like single quotes - but be careful
that some characters, like $ or ` are special when you use double
quotes).

and the "startserver.ijs" command (or whatever you decided to name it)
would include

load jpath '~addons/ide/jhs/core.ijs'

and its final statement would be:

init_jhs_ ''

...

I've not actually tried this, but I think that that should work.

Good luck,

-- 
Raul


On Fri, Sep 9, 2016 at 1:33 PM, Brian Schott <[email protected]> wrote:
> I have been interested in using jhs and html5, and revised a contract
> bridge scoring app with the help of this forum to work as such. My own
> usage of the app is both at my own house and via wifi at at a friend's
> house, periodically. As is, I use my own computer as the host and have have
> written down the several setup steps I must take each time I use the app
> because I have to:
>
> a) reset computer preferences so the computer does not shut down,
> b) launch jhs,
> c) launch jijx in the browser (maybe opening it first),
> d) load '~user/...'
> e) and then launch the locale in the browser
>
> f) reverse a) and b) at the end of the day
>
> The most recent release of JHS has theoretically combined steps b and c
> into a single step, but this is quite a list of steps, imo.
>
> I suppose a good alternative would be a dedicated web hosting service on
> which the app could be left always on. But for me a serious limitation to
> developing such apps is my resistance to paying for such a web host service
> for hosting the result and not wanting to use my own computer as the host.
>
> Am I missing a free service or am I missing a feature, or something?
>
> Thanks,
> ----------------------------------------------------------------------
> 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