Welcome, Guest. Please login or register.

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

Description:

0 Members and 1 Guest are viewing this topic.

Offline sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show only replies by sim085
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 meega

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 952
    • Show only replies by meega
Re: Are there shortcuts in Workbench 3.1?
« Reply #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 only replies by meega
Re: Are there shortcuts in Workbench 3.1?
« Reply #2 on: October 02, 2009, 02:07:55 PM »
Have you looked at the other Commodities... FKey springs to mind...
:)
 

Offline sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show only replies by sim085
Re: Are there shortcuts in Workbench 3.1?
« Reply #3 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 meega

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 952
    • Show only replies by meega
Re: Are there shortcuts in Workbench 3.1?
« Reply #4 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 only replies by meega
Re: Are there shortcuts in Workbench 3.1?
« Reply #5 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 sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show only replies by sim085
Re: Are there shortcuts in Workbench 3.1?
« Reply #6 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 meega

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 952
    • Show only replies by meega
Re: Are there shortcuts in Workbench 3.1?
« Reply #7 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 only replies by meega
Re: Are there shortcuts in Workbench 3.1?
« Reply #8 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 sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show only replies by sim085
Re: Are there shortcuts in Workbench 3.1?
« Reply #9 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 meega

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 952
    • Show only replies by meega
Re: Are there shortcuts in Workbench 3.1?
« Reply #10 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 sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show only replies by sim085
Re: Are there shortcuts in Workbench 3.1?
« Reply #11 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 meega

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

Offline AmigaHeretic

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 821
    • Show only replies by AmigaHeretic
Re: Are there shortcuts in Workbench 3.1?
« Reply #13 on: October 02, 2009, 06:01:03 PM »
Quote from: sim085;524522
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



Well, the way I do it is just make a copy of 'ClickToFront'.  Then put the copy into WBStartup.  That way all the Commodities stay where they are in that drawer.


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

So unless you're on a floppy and really need every list kilobyte, then for me this is basically the same thing as a shortcut.  (this way also if I mess with the tooltypes of the one in WBStartup I'm safe in knowing the original in the Commodities drawer is always set to the correct defaults)
A3000D (16mhz, 2MB Chip, 4MB Fast, SCSI (300+MB), SuperGen Genlock, Kick 3.1)
Back in my day, we didn\'t have water. We only had Oxygen and Hydrogen, and we\'d just have to shove them together.
 

Offline sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show only replies by sim085
Re: Are there shortcuts in Workbench 3.1?
« Reply #14 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!