comp.lang.ada
 help / color / mirror / Atom feed
From: Jerry <list_email@icloud.com>
Subject: Re: How to run a GNAT program without starting a terminal session
Date: Thu, 19 Jul 2018 04:30:00 -0700 (PDT)
Date: 2018-07-19T04:30:00-07:00	[thread overview]
Message-ID: <dab279c6-b4d1-495a-bb08-5ede470eb721@googlegroups.com> (raw)
In-Reply-To: <pipe4n$t7a$1@dont-email.me>

On Thursday, July 19, 2018 at 12:20:57 AM UTC-7, björn 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 and 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
> > 
> > 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 immediate 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 application bundle and does what I want. (The dialog box at the end is a little gratuitous.) afplay plays any audio file.
> > 
> > 
> > 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
> > 
> > 
> > What is this piece of silliness? For some time I have taken seriously the claim that sitting for long periods of time is unhealthy, and consequently I set my computer to announce the time every half hour at which time I am *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 clock to see when to stop and this does not always have a background that makes 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.
> > 
> > Jerry
> > 
> 
> 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.
> 
> 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.
> 
> But the applescript soulution may be simpler, except for you need to
> start it by yourdelf each time.
> 
> 
> 
> -- 
> --
> Björn

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 above.

The Applescript works perfectly but it's not Ada. :-( And I still don't know how to solve my original problem, how to run Ada program without a terminal session starting.

Jerry

  reply	other threads:[~2018-07-19 11:30 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-17  1:20 How to run a GNAT program without starting a terminal session Jerry
2018-07-17  4:35 ` Jerry
2018-07-17  9:55 ` AdaMagica
2018-07-17 10:08   ` Jerry
2018-07-17 10:23     ` Jerry
2018-07-17 13:13     ` Dennis Lee Bieber
2018-07-17 12:46 ` Björn Lundin
2018-07-17 16:20   ` Jeffrey R. Carter
2018-07-17 21:10     ` Jerry
2018-07-18  6:27       ` Jeffrey R. Carter
2018-07-19  1:41         ` Jerry
2018-07-19  2:31           ` Dennis Lee Bieber
2018-07-17 21:07   ` Jerry
2018-07-17 21:12     ` Shark8
2018-07-17 21:56       ` Jerry
2018-07-18  1:33         ` Shark8
2018-07-18  7:37       ` Björn Lundin
2018-07-18 16:41         ` Shark8
2018-07-18 21:18         ` Jeffrey R. Carter
2018-07-19  6:59           ` Jerry
2018-07-19 15:25             ` Dennis Lee Bieber
2018-07-19 16:50             ` Jeffrey R. Carter
2018-07-19 20:47               ` Jerry
2018-07-19  1:47         ` Jerry
2018-07-17 18:21 ` Shark8
2018-07-17 20:53   ` Jerry
2018-07-18 16:34     ` Shark8
2018-07-18 20:30       ` Björn Lundin
2018-07-18 21:09         ` Dan'l Miller
2018-07-18 21:41           ` Bill Findlay
2018-07-19  2:13             ` Dan'l Miller
2018-07-19  2:40           ` Jerry
2018-07-19  3:19             ` Dan'l Miller
2018-07-19  2:57 ` Jerry
2018-07-19  7:20   ` Björn Lundin
2018-07-19 11:30     ` Jerry [this message]
2018-07-19 16:40       ` Björn Lundin
2018-07-19 20:46         ` Jerry
2018-07-20  7:32           ` Björn Lundin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox