![]() |
![]() |
#1 |
Registered User
Join Date: Aug 2009
Location: Waco USA
Posts: 253
|
Running Workbench program from CLI (at startup.)
I have a nice little program I came across that changes the look of system request boxes. The problem I'm running into is getting it to start automatically. If I double click on the Icon from Workbench, everything is fine. The program runs, stays in the background, and does what it is supposed to do. The problem I'm facing is that if I run it from CLI (such as in User-Startup,) then the CLI window will never close. I've tried using the run command, and even putting it in a script file and doing a run execute. It all results in the CLI window staying open. The system will complete the bootup, without a problem, and I can even shrink the window down and access everything just fine. With Workbench 2+ I would just put it in the WBStartup drawer. But Workbench 1.3 doesn't have that (and it doesn't run under 2+.) Is there any way to make it run detached, or to have LoadWB run it as if it had been double clicked? I don't remember ever having to do something like this, and I'm not having much luck finding information in a search.
|
![]() |
![]() |
#3 |
Registered User
Join Date: Oct 2012
Location: Germany
Posts: 585
|
|
![]() |
![]() |
#4 | |
Registered User
Join Date: Aug 2009
Location: Waco USA
Posts: 253
|
Quote:
![]() I've actually never run a program like that. I just used "run command". I usually prefer to see the "startup" messages programs give when you run them during the startup-sequence. |
|
![]() |
![]() |
#5 |
Registered User
Join Date: May 2001
Location: ?
Posts: 19,665
|
Well if you don't RUN it the shell will be waiting for it to return but it never will until you close it. So your only choice is to run it. I guess WBRun basically just runs the WB app in a new shell.
|
![]() |
![]() |
#6 |
Registered User
Join Date: Aug 2009
Location: Waco USA
Posts: 253
|
I'm using the run command... Exact command variations:
"run sys:system/newareq" "run execute s:newareq.s" {one line in script: "run sys:system/newareq"} "run execute s:newareq.s" {two lines in script: "run sys:system/newareq" & "endcli"} All 3 in S:Startup-Sequence and in S:User-Startup. Not one variation made a difference except in the "[CLI #]" messages in the boot CLI screen. I tried putting in the re-directors (along with the .bra & .ket lines,) you suggested, but it then just asked for volume ">nil" to be inserted. |
![]() |
![]() |
#7 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,419
|
Was the <> form of redirection supported under 1.3? I don't remember ever using it like that before 3.0... The thing is, that redirection won't make a difference to the command working or not anyway. So does WBRun not work as you need it to?
|
![]() |
![]() |
#8 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,381
|
Along with the .bra .ket? What .bra .ket lines?
|
![]() |
![]() |
#9 |
Registered User
Join Date: May 2001
Location: ?
Posts: 19,665
|
I think redirection is supported under 1.3 but .bra and .ket isn't.
Also I just noticed this was meant to be on 1.3. As far as I know 1.3 cannot multitask in that way, so it won't work. |
![]() |
![]() |
#10 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,381
|
Why wouldn't it work?
Also, I think Daedalus is on to something about <> redirection. You probably need to write <NIL: >NIL: instead of <>NIL: |
![]() |
![]() |
#11 |
Registered User
Join Date: May 2001
Location: ?
Posts: 19,665
|
Because it isn't implemented in the same way. Go ahead and try it, I just did because I don't have much experience with 1.x. I wouldn't know of any further explanation, but we all know 1.3 was sort of multitasking and only 2.x brought proper multitasking.
I edited the Workbench 1.3 startup sequence to RUN SYS:PREFS/Preferences before Loadwb did. System "opened" a new CLI (in the same window, [CLI 2]) , then loaded Preferences but did NOT continue running the script until I closed Preferences. Either the system doesn't support multitasking in that way or the 1.3 command doesn't work in the same way as in 2.x Redirecting to NIL: only redirects the output of the command, it has no effect on whether the script waits for the command to return or not. RUN or RUN >NIL: do the same in 2.x (open command in new process so script in the process it was executed from can keep on running) |
![]() |
![]() |
#12 |
Registered User
Join Date: Aug 2009
Location: Waco USA
Posts: 253
|
WBRun works just fine in 1.3, and it solved my problem. I thought I said that in my second post.
.bra & .ket also work in 1.3, and was needed because <> is normally used for variable insertion. .bra .ket replaces those so that the <> would be recognized as an input/output redirection instead of a variable marker. I didn't realize that the suggested run command would look at it that way until I got the error message the first time I tried to use it. I added in the the .bra .ket commands so that it would look at it the way that bubbob42 wanted it to be used instead. However, 1.3 does not support <>nil: that way. It looked at it as input from volume ">nil" instead of the double redirection that I believe was intended. However, changing it to <nil: >nil: also didn't seem to have an effect on keeping the process separate from the CLI. WBRun does that for me now, so that I can put it in my startup sequence instead of having to manually double-click the icon every time. The only issue is that I have to have it after the loadwb command, so it can't be in my User-Startup (where I like to keep all my changes & additions if I can,) but in the main Startup-Sequence. |
![]() |
![]() |
#13 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,381
|
I don't know what you intend by multitasking, but 1.3 is just as multitasking as 2.0.
|
![]() |
![]() |
#14 | |||
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,419
|
Quote:
![]() Quote:
Quote:
|
|||
![]() |
![]() |
#15 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,419
|
Yep, true. Perhaps it's a limitation of the old Shell that 1.x uses before NEWCON: is mounted. The default ROM-based CLI in 1.x is pretty limited from memory, so you need to mount NEWCON: to make the updated shell available.
|
![]() |
![]() |
#16 | |
Registered User
Join Date: Aug 2009
Location: Waco USA
Posts: 253
|
Quote:
![]() Basically, I would need to WBRun every icon in the drawer. Easy to build a list of them, but passing them, one at a time, to WBRun could be problematical. I haven't build complex scripts like that on the Amiga before, will have to do some research. |
|
![]() |
![]() |
#17 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,381
|
It's easy with List LFORMAT, assuming that is supported in 1.3.
|
![]() |
![]() |
#18 |
Registered User
Join Date: Aug 2009
Location: Waco USA
Posts: 253
|
Yes, List will get me a list of all the Icon files. The issue comes with setting it up so that I can do a WBRun on each one individually. That takes a little bit of advanced scripting. If I was just running them, I would just create the list and treat it as a script file (which is what WB 2+ does with the Monitors directory.) However, I need to append "WBRun " at the beginning of each line before running it as a script. I'm not exceptionally familiar with Amiga OS scripting language. All I've rally done (language wise,) so far is basic if else type functions. Have also set up lab & skip activities as well. So, that's what I'm going to have to study, to see if it can be done.
|
![]() |
![]() |
#19 |
Registered User
Join Date: Aug 2009
Location: Waco USA
Posts: 253
|
OK, it won't let me edit my post for some reason...
lformat looked like it would work after all. But it won't let me strip the .info off of each line. WBLoad is designed to load an icon, and then execute that icon as if it had been double clicked. However, it adds the .info itself, so I need to create the list without the .info, but only for .info files. I tried switching to WBRun instead, but the parm.library is giving me fits. I found the parm.library (eventually,) on a fred fish disk, but even with it in my libs: directory (and after a reboot as well,) it still throws up a parm.library v1+ required message when I try to use it. |
![]() |
![]() |
#20 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,381
|
Try if this works in 1.3:
Code:
List LFORMAT "WBRun %M" #?.info |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to make an Workbench Icon running a CLI Script ? | Marskilla | support.Other | 9 | 26 April 2016 23:11 |
External windows program communicating with program running inside WinUAE | xxxxx | support.WinUAE | 10 | 19 February 2013 09:27 |
Possible to run a program from CLI in background? | VoltureX | support.Apps | 17 | 14 January 2012 03:16 |
CLI program to resturn joy direction or fire button. | olesio | request.Apps | 26 | 04 November 2011 18:18 |
CLI program to make mouse pointer dissapear on KS 3.X | Gaula92 | request.Apps | 5 | 21 October 2011 14:49 |
|
|