Welcome, Guest. Please login or register.

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

Description:

0 Members and 1 Guest are viewing this topic.

Offline meega

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 952
    • Show all replies
Re: Are there shortcuts in Workbench 3.1?
« on: October 02, 2009, 01:56:36 PM »
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).

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.
« Last Edit: October 02, 2009, 02:03:18 PM by meega »
:)
 

Offline meega

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 952
    • Show all replies
Re: Are there shortcuts in Workbench 3.1?
« Reply #1 on: October 02, 2009, 02:07:55 PM »
Have you looked at the other Commodities... FKey springs to mind...
:)
 

Offline meega

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 952
    • Show all replies
Re: Are there shortcuts in Workbench 3.1?
« Reply #2 on: October 02, 2009, 02:15:27 PM »
Quote from: sim085;524527
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!
That's about the size of it - but the WBStartup drawer does things as if you had double-clicked on the icons, which means that the Tooltypes get parsed, which does not necessarily happen when you launch things from scripts. You sometimes need to add keywords like QUIET etc.


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

Use a text editor, type something, save it.

Then look at the protection bits (Icon Info stuff, or shown in file-listers). If it has the "s" bit set then it's a script. If not, you set that bit, now it's a script. ;)

Ed: there's a little more to it, but not much. The "rwed" bits have some relevance, particularly the "e" bit. If that is NOT set then the file is a project (which might be a script, might be data, or almost anything) and the file is NOT "Executable" by direct clicking on it, or naming it, etc. You have to type the command "Execute scriptname" in that case, this overrides the protection bits status.

If the "e" bit IS set then you can run the file/program by clicking on it or naming it, but that doesn't make it a script even though it could well be one. :) It is the "s" bit that says "script file intended to be used from the Shell/CLI" and if it is also "e" set then you can call it by name and it gets executed as if it were a regular program.
« Last Edit: October 02, 2009, 02:21:57 PM by meega »
:)
 

Offline meega

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 952
    • Show all replies
Re: Are there shortcuts in Workbench 3.1?
« Reply #3 on: October 02, 2009, 02:23:54 PM »
The Startup-Sequence is a good example of a script, as are some of the other files in the S directory.
:)
 

Offline meega

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 952
    • Show all replies
Re: Are there shortcuts in Workbench 3.1?
« Reply #4 on: October 02, 2009, 03:04:32 PM »
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.
« Last Edit: October 02, 2009, 03:07:51 PM by meega »
:)
 

Offline meega

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 952
    • Show all replies
Re: Are there shortcuts in Workbench 3.1?
« Reply #5 on: October 02, 2009, 03:11:22 PM »
As an aside, if ClicktoFront is the only thing you've got in WBStartup, I'd be inclined to just leave it there.
:)
 

Offline meega

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 952
    • Show all replies
Re: Are there shortcuts in Workbench 3.1?
« Reply #6 on: October 02, 2009, 03:29:46 PM »
Quote from: sim085;524537
Thanks :) Now all I have to do is find out how to create Project icons!


IconEdit, in the Tools drawer.
:)
 

Offline meega

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 952
    • Show all replies
Re: Are there shortcuts in Workbench 3.1?
« Reply #7 on: October 02, 2009, 03:42:33 PM »
.KEY .BRA .KET etc... ;)
:)
 

Offline meega

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 952
    • Show all replies
Re: Are there shortcuts in Workbench 3.1?
« Reply #8 on: October 02, 2009, 08:59:41 PM »
Put them in the same directory... they should be named "myscript" and "myscript.info" (or any other name of your choosing, but there must be a file and a file.info in the same directory).


Ed: alternatively, look at the Shell icon, "FROM=S:Shell-Startup" tooltype as an example of how to use a different file. (This might be restricted in how you can use it.)
« Last Edit: October 02, 2009, 09:03:22 PM by meega »
:)