View Single Post
Old 08 January 2007, 00:38   #2
Registered User
rsn8887's Avatar
Join Date: Oct 2006
Location: USA
Posts: 787
I think you can just create 2 new shell script (text)files with ed or ced or some editor.

For example, make one file called "startUSB" and one called "stopUSB" and put the respective line of code in each.

Then make them executable shell scripts by using the protect command to add the s (for script) flag to their file attributes, for example
"protect startUSB s add" and "protect stopUSB s add". With the s flag, amigados and workbench will treat them as executable shell scripts.

Put both files in "sys:s", or in "sys:c" or some other directory where you keep your shell scripts.

Then attach them as shell commands to an Amidoc icon. I only use toolmanager. In toolmanager, I think you first create a button, then tell it the command to execute upon click (your newly created scripts) and then choose an icon for the button. I bet Amidoc works similar.

You can also create workbench icons for the scripts, since they are executable now. I don't remember so well how. This is long way but should work:
Use some tool-icon as template. It must be an icon that runs a shell-command, like one of your whdload game icons. Copy that icon (it is a .info file) over to the same directory as your script files and rename it to "". Do same again but rename to "". Use file info window on workbench to change the icons' commands to e.g. "sys:s/startUSB" and "sys:s/stopUSB". Then use favorite icon editor to change appearance.

You can get more fancy and just use one script with options, e.g.
a script called "switchUSB" with keyword arguments "switchUSB on" and "switchUSB off". To do that, you have to use the ".bra {" and ".ket }" etc. notation to define command line arguments inside your script files.

Alternatively you can make one "toggleUSB" script that sets an env-variable whether USB is on or off, and switches accordingly to that env-variable. There you have to use $ notation for accessing env-variables.

Last edited by rsn8887; 08 January 2007 at 00:46.
rsn8887 is offline  
Page generated in 0.03902 seconds with 10 queries