English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System > Coders. Scripting

 
 
Thread Tools
Old 04 November 2022, 10:38   #1
Gilloo
Registered User
 
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 289
IconX, Ask and Workbench 1.3

Got this little script shell named test

echo "Hello world"
ask "continue ?"
if WARN
echo "you are OK to continue"
else
echo "All right, I do nothing"
endif
echo "Have an nice day"
wait 10


I set protect test +s

On a CLI, no problem, correct execution in 1.3 or 3.1 and upper.

I add a project icon, set C:IconX as default tool
With 3.1 and upper, no problem, the script acts like a charm as under CLI
but with 1.3, the script ends on the ask line...
Is a there a way to workaround this
Thanks in advance.
Gilloo is offline  
Old 04 November 2022, 17:04   #2
malko
Ex nihilo nihil
 
malko's Avatar
 
Join Date: Oct 2017
Location: CH
Posts: 4,884
I think you will benefit from the adding of a line in your script, like this :
Code:
.key dummy/k
echo "Hello world"
ask "continue ?"
if WARN
echo "you are OK to continue"
else
echo "All right, I do nothing"
endif
echo "Have an nice day"
wait 10
malko is offline  
Old 04 November 2022, 18:59   #3
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,233
Quote:
Originally Posted by Gilloo View Post
Is a there a way to workaround this
Thanks in advance.
Yes. Use kickstart 2.0 or better. This cannot possibly work under 1.3. The problem is due to a design issue of the BCPL shell and the dos Execute() function.


Problem is that for ask to work, it needs an input stream to read data from. Problem is that the only way how to start a shell (and that is the method IconX uses) is the Execute() function call. You can surely provide an input stream to Execute. However, if you do, the shell started by Execute() will continue reading from this input stream as soon as the command string has been operated on. Simply put, if IconX would provide an input stream, it would start a new shell and would continue waiting for command input after the script has been worked through.


Under 2.0, the shell, shell startup and dos.library were completey reworked, and the System() function call allows running a shell that returns if the command stream is exhausted, even if an input stream is present.


PS: Note that dos/Execute() has (almost nothing) to do with the Execute command. The latter does something very different (and, in particular, does not start a shell, just redirects its input).
Thomas Richter is online now  
Old 04 November 2022, 19:20   #4
AMIGASYSTEM
Registered User
 
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,252
Hi Thomas Richter, for OS 1.3 is there also Xicon, start the Shell but seems not to work with that script ?

http://aminet.net/package/util/batch/Xicon
AMIGASYSTEM is offline  
Old 04 November 2022, 20:41   #5
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,233
...and there is CLICon, which offers even more options, but again, see above. The trouble is not "how you do it". It is really a limitation of a shell. As soon as the 1.3 shell receives a standard input, and its command stream runs dry, it will continue pulling commands from CIS and hence will turn into an interactive shell. Actually, the "only" thing endcli does is to remove this standard input, and thus terminate the shell.
Thomas Richter is online now  
Old 04 November 2022, 21:09   #6
malko
Ex nihilo nihil
 
malko's Avatar
 
Join Date: Oct 2017
Location: CH
Posts: 4,884
And there is also just plain 1.3.3 Workbench (fresh install, air, sun - no OGM, no add-ons ) which works nicely with this script if you add a simple line in the beginning

malko is offline  
Old 04 November 2022, 21:28   #7
AMIGASYSTEM
Registered User
 
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,252
I had suspected that there was a missing option in Tooltypes.
AMIGASYSTEM is offline  
Old 04 November 2022, 22:51   #8
malko
Ex nihilo nihil
 
malko's Avatar
 
Join Date: Oct 2017
Location: CH
Posts: 4,884
^ why do you think there was a missing option in ToolType ?
Because I used the same icon (thus ToolTypes) for the original and the modified version. Only the position of the windows is different.
malko is offline  
Old 04 November 2022, 22:55   #9
TCD
HOL/FTP busy bee
 
TCD's Avatar
 
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,603
Quote:
Originally Posted by malko View Post
^ why do you think there was a missing option in ToolType ?
Because I used the same icon (thus ToolTypes) for the original and the modified version. Only the position of the windows is different.
Because obviously it can't be as easy as adding one line to the script
TCD is online now  
Old 04 November 2022, 23:46   #10
malko
Ex nihilo nihil
 
malko's Avatar
 
Join Date: Oct 2017
Location: CH
Posts: 4,884
Quote:
Originally Posted by TCD View Post
Because obviously it can't be as easy as adding one line to the script
Sometimes it is

Quote:
Originally Posted by Thomas Richter View Post
[...] Under 2.0, the shell, shell startup and dos.library were completey reworked, and the System() function call allows running a shell that returns if the command stream is exhausted, even if an input stream is present. [...]
Was the 2.0 Shell really completely reworked ?
In the big lines I understood that it was "simply" the 1.3 NEWCON: that was integrated in the usual CON: (not to have like as with 1.3 CON: & NEWCON: ).
malko is offline  
Old 05 November 2022, 00:38   #11
AMIGASYSTEM
Registered User
 
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,252
Quote:
Originally Posted by malko View Post
^ why do you think there was a missing option in ToolType ?

I had used an icon created new with no commands in the tooltypes
AMIGASYSTEM is offline  
Old 05 November 2022, 00:46   #12
TCD
HOL/FTP busy bee
 
TCD's Avatar
 
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,603
Quote:
Originally Posted by malko View Post
Sometimes it is
I know Good luck!
TCD is online now  
Old 05 November 2022, 08:45   #13
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,000
Quote:
Originally Posted by malko View Post
Sometimes it is
In the big lines I understood that it was "simply" the 1.3 NEWCON: that was integrated in the usual CON:
CON/NEWCON is only the window handler. It has nothing to do with CLI/Shell.

It's rather l:shell-seg which was reworked/integrated into Kickstart.
thomas is offline  
Old 05 November 2022, 13:33   #14
Gilloo
Registered User
 
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 289
Quote:
Originally Posted by malko View Post
I think you will benefit from the adding of a line in your script, like this :
Code:
.key dummy/k
echo "Hello world"
ask "continue ?"
if WARN
echo "you are OK to continue"
else
echo "All right, I do nothing"
endif
echo "Have an nice day"
wait 10
@malko Great !
with 34.20 the .key seems to be mandatory to make the script work correctly with IconX

Many thanks for your help.
Gilloo is offline  
Old 05 November 2022, 18:49   #15
malko
Ex nihilo nihil
 
malko's Avatar
 
Join Date: Oct 2017
Location: CH
Posts: 4,884
Quote:
Originally Posted by thomas View Post
CON/NEWCON is only the window handler. It has nothing to do with CLI/Shell.
It's rather l:shell-seg which was reworked/integrated into Kickstart.
Thanks for the precision.

Quote:
Originally Posted by Gilloo View Post
@malko Great !
with 34.20 the .key seems to be mandatory to make the script work correctly with IconX
Many thanks for your help.
You are welcome.
malko is offline  
Old 06 November 2022, 10:23   #16
Gilloo
Registered User
 
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 289
@malko
A small question that has nothing to do with the subject "IconX, Ask and WB1.3"
How you have captured the WinUAE output and transform it in a simple .gif ?
I thought we could only release it in .avi
Gilloo is offline  
Old 06 November 2022, 11:16   #17
malko
Ex nihilo nihil
 
malko's Avatar
 
Join Date: Oct 2017
Location: CH
Posts: 4,884
It's a two steps process :

1. Capture using GifCam
2. Clean/optimise/speed with Gimp (it could be done with GifCam but I am used to Gimp, so...).

Then upload where you want. I use 'imgbb' (free, convenient, fast & support animated gif (as well no auto-delete)).

malko is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
IconX - read tool types from script? Sim085 support.Apps 15 26 August 2020 10:37
IconSet (IconX?) how to add new icon sets? Sim085 support.Other 3 06 March 2015 13:37
IconX Error on Startup kratam support.Apps 1 11 August 2012 02:02
How to redirect the output of IconX to a file tygre support.Apps 8 10 July 2011 05:29
Execute script works but not after adding an icon with IconX as Default Tool. e5frog support.Other 19 27 July 2010 10:23

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:31.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09087 seconds with 13 queries