[comp.sys.amiga.misc] Execute script from icon

bpv9073@sjfc.UUCP (Brett VanSprewenburg) (01/31/91)

[ I shot the line eater ]

I am setting up my new harddisk system on my A500 and don't wish
to have all my path assigns for Pro-Page, Word Perfect, and NetHack...
etc, etc hanging around when I don't need them. 

What I wish to do is to click on an icon from the WB and have it
execute an assign script which does all the dirty work for me. 
I know I could do this from the cli, but having a GUI is supposed to 
save time/effort. So you see where I'm coming from.

Anyway, I've tried several combination of tools/project icons with
varying ways of attempting to invoke my script file of AmigaDOS commands.
No luck, best I've gotten are GURU's of the xx4.xxx nature.

Thanks for the info...

==Brett    ...uupsi!cci632!sjfc!bpv9073

peterk@cbmger.UUCP (Peter Kittel GERMANY) (02/01/91)

In article <1222@sjfc.UUCP> bpv9073@sjfc.UUCP (Brett VanSprewenburg) writes:
>
>What I wish to do is to click on an icon from the WB and have it
>execute an assign script which does all the dirty work for me. 
>I know I could do this from the cli, but having a GUI is supposed to 
>save time/effort. So you see where I'm coming from.

Look up your manual for the IconX command.
Make up a script file (using e.g. ed) that contains all the assigns,
cd's PLUS the call for the real application. Then copy a "project"
type icon (e.g. notepad file). Say, your file is named StartMe,
then copy that notepad icon file (the .info file) to a new file
named StartMe.info. Make this icon appear on the Workbench, click
once on it, and choose Info from the Workbench menu (Icons/ Informations
under 2.0). Set the default tool to c:Iconx. If you want, you can add
tool types to set the window size for IconX. And as last action you
may use IconEd to change the shape of the icon after your taste.

If your script file contains commands that need user input (e.g. ask),
then you have two possibilities:
  a) the elegant one, as stated in the manual, but sometimes not
     so satisfying for me: add a .key line at the beginning of your
     script (see manual).
  b) the brute force method will provide a *real* CLI environment,
     but needs a second script file. Rename your above mentioned
     script file to StartMe.s . Make a second script file with name
     StartMe and following contents:
        NewShell  newcon:0/15/580/180/StartMe  from  StartMe.s
        endcli
     (You may use different window dimension/titles/filenames.)
     But with this method you not only get two script files, but also
     two windows on the screen, where one of them disappears soon again.

-- 
Best regards, Dr. Peter Kittel  // E-Mail to  \\  Only my personal opinions... 
Commodore Frankfurt, Germany  \X/ {uunet|pyramid|rutgers}!cbmvax!cbmger!peterk

walrus@wam.umd.edu (Udo K Schuermann) (02/01/91)

In article <1222@sjfc.UUCP> bpv9073@sjfc.UUCP (Brett VanSprewenburg) writes:
>I am setting up my new harddisk system on my A500 and don't wish
>to have all my path assigns for Pro-Page, Word Perfect, and NetHack...
>etc, etc hanging around when I don't need them. 
>
>What I wish to do is to click on an icon from the WB and have it
>execute an assign script which does all the dirty work for me. 
>
>==Brett    ...uupsi!cci632!sjfc!bpv9073

Use a PROJECT icon (named, say, Nethack) that runs c:IconX.
Rename Nethack to Nethack3.0 and create a script named Nethack
(which matches the Nethack.info (project)):
	assign nethack: games:nh30
	cd nethack:
	Nethack3.0	; the executable
	assign nethack: remove

If you want to get rid of the window that IconX puts up, add
the following tool type:
	WINDOW=NIL:

The : (colon) is important.  All output will go to the NULL
device, I believe, which must be mounted.

I hope this is clear enough so you can apply it to other
applications, too.

Cheers,
				 ___
 ._.  Udo Schuermann		/ | \	"There is no Way to Peace.
 ( )  walrus@wam.umd.edu	\/|\/	 Peace is the Way!"  -- Gandhi.
				 ~~~