Welcome, Guest. Please login or register.

Author Topic: Are there shortcuts in Workbench 3.1?  (Read 3637 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show all replies
Are there shortcuts in Workbench 3.1?
« on: October 02, 2009, 01:23:44 PM »
Hi,

I would like to make the commodity 'ClickToFront' run on Workbench Start-up. Of course I could just move this commodity to the WBStartup (as I am doing now).

However is there maybe a way I can do a short-cut so that I leave the ClickToFront commodity in the Commodities directory and just put a short-cut in the WBStartup directory?

Regards,
Sim085
 

Offline sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show all replies
Re: Are there shortcuts in Workbench 3.1?
« Reply #1 on: October 02, 2009, 02:09:25 PM »
Quote from: meega;524524
The User-Startup can be used (create one if it isn't already in the S directory).

Run >NIL: SYS:Tools/Commodities/ClickToFront

Ed: it might not need to be Run, it might just need to be called... in which case

"ClickToFront"

will do (the User-Startup is executed after the Path statement, so it will be found, or you could explicitly give its full path).


However if I do this then the WBStartup directory under system would be pritty much useless right? I could put any application I want to run from startup in the User-Startup file!

Quote from: meega;524524
You could save this snippet as a separate script, and set its protection bits appropriately, and possibly give it an icon, and then when you double-click on the icon the script will get run and the comodity will be fired up. Etc.

In other words, yes, there are ways to do things.


How do I go an create a script file? Are there any examples anywhere (maybe already on Workbench)?
 

Offline sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show all replies
Re: Are there shortcuts in Workbench 3.1?
« Reply #2 on: October 02, 2009, 02:50:33 PM »
Quote from: meega;524530
The Startup-Sequence is a good example of a script, as are some of the other files in the S directory.

Thanks :) Maybe I am pushing this a little; but can parameters be passed to script file? Something like project icons!
« Last Edit: October 02, 2009, 03:03:30 PM by sim085 »
 

Offline sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show all replies
Re: Are there shortcuts in Workbench 3.1?
« Reply #3 on: October 02, 2009, 03:18:19 PM »
Quote from: meega;524535
Have a look at the "Shell" icon in the System drawer, you'll see how Workbench does things...

Scripts can indeed accept parameters/arguments. Some of mine use up to four.


Also, Ed: study the scripts in S, look at SPat, DPat, and PCD. Think about what is going on, and you will be able to write your own scripts for all sorts of weird things.


Thanks :) Now all I have to do is find out how to create Project icons!

Quote from: meega;524536
As an aside, if ClicktoFront is the only thing you've got in WBStartup, I'd be inclined to just leave it there.


Yes I know, but I would like to have everything in order ... and at the same time I learn how to build simple scripts on Workbench (it might help on my CV ;))
 

Offline sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show all replies
Re: Are there shortcuts in Workbench 3.1?
« Reply #4 on: October 02, 2009, 03:39:27 PM »
Quote from: meega;524538
IconEdit, in the Tools drawer.


Thanks :) I have done my first script with an icon!! Now I'll check the other scripts you suggested so that I can learn some syntax will try to build a shortcut tool :)
 

Offline sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show all replies
Re: Are there shortcuts in Workbench 3.1?
« Reply #5 on: October 02, 2009, 08:09:16 PM »
Quote from: AmigaHeretic;524546

'ClickToFront' is less than 4k in size.  A shortcut in Windows probably is larger in size than that. ;-)


I know but I just want everything to be organised.

At the moment I have a problem. I created my scrypt under SYS: and a new icon (project) in a partition Documents: however I cannot understand how to make this icon execute the script in SYS!
 

Offline sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show all replies
Re: Are there shortcuts in Workbench 3.1?
« Reply #6 on: October 02, 2009, 09:35:15 PM »
Thanks again. I managed to make the script run by using the FROM parameter as you suggested :) I then used the RUN command to run the wanted program.

I now just have to understand how I can use the CLI to run a script without actually opening the CLI window.

Rather then asking one question at a time (hopefully not annoying you) - is there a place where I can learn more about these things.
 

Offline sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show all replies
Re: Are there shortcuts in Workbench 3.1?
« Reply #7 on: October 02, 2009, 10:10:30 PM »
Using

Run >NIL: myscript
EndCLI

I managed to run the script and close the CLI window. This is good enough for me for now. However I am intrested to know if it is possible to run the script without actually opening the CLI window (maybe through some other way?).

I tried to play a little with the IconX - however I think this is only usefull when the script and the icon are in the same directory, which is not my case.