From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DIET_1,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:6285:: with SMTP id d127-v6mr2668261itc.0.1531999800803; Thu, 19 Jul 2018 04:30:00 -0700 (PDT) X-Received: by 2002:aca:2b06:: with SMTP id i6-v6mr1878535oik.0.1531999800658; Thu, 19 Jul 2018 04:30:00 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!d7-v6no654449itj.0!news-out.google.com!k71-v6ni1645itk.0!nntp.google.com!d7-v6no654448itj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 19 Jul 2018 04:30:00 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=71.209.154.211; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG NNTP-Posting-Host: 71.209.154.211 References: <8771f075-4142-45ef-b636-80d407fedd7f@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: How to run a GNAT program without starting a terminal session From: Jerry Injection-Date: Thu, 19 Jul 2018 11:30:00 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:53908 Date: 2018-07-19T04:30:00-07:00 List-Id: On Thursday, July 19, 2018 at 12:20:57 AM UTC-7, bj=C3=B6rn lundin wrote: > On 2018-07-19 04:57, Jerry wrote: > > On Monday, July 16, 2018 at 6:20:50 PM UTC-7, Jerry wrote: > >> How can I get Ada (GNAT) to run a program that has no text I/O without= launching a terminal session? Specifically, on macOS, I have the following= program. When I double-click it, it runs but first it opens Terminal.app a= nd starts a session. I played with calling it from Applescript but without = success. Can I make a bash file that doesn't start a terminal session? > >> > >> > >> with Ada.Calendar; use Ada.Calendar; > >> with Common; -- Contains "Beep". > >> > >> procedure Run is > >> begin > >> Delay 4.0; > >> Common.Beep(1); > >> end Run; > >> > >> > >> Jerry > >=20 > > It looks like there is no easy answer to the original question, how to = run a GNAT program without a terminal, but here is a solution to my immedia= te problem with some do-dads added. Sorry, it's not Ada. It's Applescript. = The Applescript compiler bundles this up nicely as a double-clickable appli= cation bundle and does what I want. (The dialog box at the end is a little = gratuitous.) afplay plays any audio file. > >=20 > >=20 > > delay 30 > > do shell script "afplay '/System/Library/Sounds/Frog.aiff'" > > delay 15 > > do shell script "afplay '/System/Library/Sounds/Ping.aiff'" > > delay 13 > > beep > > delay 1 > > beep > > delay 1 > > beep > > say "Stop running Jerry" volume 0.5 > > display dialog "Stop running!" buttons {"OK"} default button 1 > >=20 > >=20 > > What is this piece of silliness? For some time I have taken seriously t= he claim that sitting for long periods of time is unhealthy, and consequent= ly I set my computer to announce the time every half hour at which time I a= m *supposed* to get up and run in place for one minute. I believe that this= is a simple version of interval training and can actually cause me to lose= a little weight. The problem is that I have to watch an analog on-screen c= lock to see when to stop and this does not always have a background that ma= kes the clock easy to see, plus I have to stick next to the computer. Using= a utility, I launch this program with a simple key combination. > >=20 > > Jerry > >=20 >=20 > Ah. Applescript is kind of fun. > Until you want to do some advance stuff. > I used to script apple iTunes and iPhote with a python binding to > applescript. worked better than I thoufht. >=20 > Anyway, your usercase does sound like you want a daemon. > make it start at boot, and then run forever. > That is what launchctrl is about. >=20 > But the applescript soulution may be simpler, except for you need to > start it by yourdelf each time. >=20 >=20 >=20 > --=20 > -- > Bj=C3=B6rn I _want_ to start it myself each time, approximately every 30 minutes, and = it is designed to stop running after one minute. See my "running" post abov= e. The Applescript works perfectly but it's not Ada. :-( And I still don't kno= w how to solve my original problem, how to run Ada program without a termin= al session starting. Jerry