22 April 2018, 09:36 | #1 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
Icon for script on main Workbench window?
I have been trying to take a script I wrote and stored in System:S and put it onto the main Workbench screen as an icon, so I can quickly and easily run it without having to open the relevant windows, "Execute Command" or DOpus.
How can I create an icon for a script, or indeed any file? It's been decades since I did it, and I've forgotten. |
22 April 2018, 10:01 | #2 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
One way is to use IconEdit in Tools, save an icon of type "Project", and set its default tool to "C:IconX"
|
22 April 2018, 10:15 | #3 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
Thank you, it worked great.
|
22 April 2018, 10:42 | #4 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,265
|
You can also run a script as if it were an executable, to do this, just add the flag S (Script) to the file. From Workbench you can run this script by adding a "Tool" type icon
|
22 April 2018, 12:12 | #5 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,310
|
DOpus has an AddIcon funktion. Select your file and hit AddIcon button. Or copy an icon you like and rename it to the script name. You can also add a hotkey for the script start. Then no icon is needed.
|
25 April 2018, 14:16 | #6 | |
Banned
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
|
Quote:
You can also use ProcessIcon (http://aminet.net/package/util/wb/ProcessIcon) Code:
ProcessIcon MyScript SIT Tool |
|
25 April 2018, 14:24 | #7 |
Banned
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
|
Yeah, with Workbench, IIRC, an icon will be created once you stuff tooltypes etc into wbinfo window and hit "save". And you can of course use the OS commodity FKey to add hotkeys for launching scripts, instead of having icons on the Workbench.
|
25 April 2018, 22:57 | #8 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 5,065
|
WB 1.3 is not really user-friendly when dealing with icon type.
If you want to change the type of an Icon to "Project" : 1- Load IconEdit 2- (slot 1) Open an already existing icon having the type "Project" 3- In a new slot (let's say slot 2), open the icon you want to change the type 4- Copy the icon opened in point 3- (slot 2) over the icon opened in point 2- (slot 1) 5- Save the icon (slot 1) The icon has now the type "Project" |
25 April 2018, 23:45 | #9 | ||
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,265
|
Quote:
Quote:
[ Show youtube player ] Last edited by AMIGASYSTEM; 11 May 2018 at 01:37. |
||
26 April 2018, 00:19 | #10 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,265
|
|
26 April 2018, 07:00 | #11 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
Thanks, all. Getting the script to run from an icon has been solved. I used IconEdit and dragging the script to it and setting the icon type, but haven't tried the DOpus Add Icon button yet.
|
26 April 2018, 08:05 | #12 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 5,065
|
|
26 April 2018, 11:07 | #13 | |
Banned
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
|
Quote:
With shell v45 from ThoR you can even "launch" other types of files the same way, as it supports datatypes. You just set the variable "VIEWER" to Multiview, and then you can just type "HELP:english/sys/amigaguide.guide" and it will open that file in Multiview. For this to work, the specified file must specifically _not_ have the E (executable) flag set. Last edited by kolla; 26 April 2018 at 11:22. |
|
26 April 2018, 11:27 | #14 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,265
|
No, just execute is in C, and then the script can be executed directly as an executable, see my video attached
Last edited by AMIGASYSTEM; 06 June 2018 at 16:15. |
26 April 2018, 13:31 | #15 |
Banned
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
|
You have a very simplified view of how this works
You should think of the S flag as a way to tell the shell that "Execute" is the default tool for a file - that is all. Likewise - if you remove the E flag, and have no S flag, it tells the shell to attempt opening the file with the program specified with the $VIEWER variable, if that variable is present. Likewise - if you set the H flag, and the P flag is present, it tells the shell to also make the program resident when running it. Last edited by kolla; 26 April 2018 at 13:39. |
26 April 2018, 13:36 | #16 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,265
|
Normal that I need to give something to start (Windows does the same thing with the .bat files), even a normal executable needs a library, font or other to start.
|
27 April 2018, 00:53 | #17 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 5,065
|
From "The Best Amiga Tricks & Tips ©1989 Data Becker, GmbH & ©1990 Abacus" :
Code:
PROTECT FILE/A,FLAGS,ADD/S,SUB/S Determines the protection bits a file should have. FILE The name of the file to protect. FLAGS Sets the protection status. R The file can be read. W The file can be written to. D The file is deletable. E The file is executable. In V1.3 the Hidden (H), Script (S), Pure (P) and Archive (A) bits can be set or reset. H Hidden file. S The file can be started without execute (script files only). P The file can be placed in the Resident list A The file is archived. The H and A bits function only with Kickstart 1.3. +, ADD Sets the status of the given Status bit. -. SUB Removes the status of the status bit. V2.0 ALL/S,QUITE/S ALL Multiple files may now be protected. QUIET No messages are displayed. |
27 April 2018, 01:14 | #18 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,265
|
|
27 April 2018, 11:57 | #19 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,381
|
It also talks about the H bit meaning "hidden" and the A bit only working under 1.3, so it's probably not the best source of information.
I did think that the E bit should also be set when the S bit is set (as in, it's an executable script), but I can't find any reference to it being either required or forbidden for scripts. It simply seems to be irrelevant when the S bit is present. |
27 April 2018, 12:36 | #20 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,265
|
The bit "E" it is not necessary to run a script or Icon, The bit "E" it is instead necessary on the real executables otherwise they do not start.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Icon Theming Script | TuKo | Coders. General | 4 | 19 February 2017 16:24 |
WB 3.1 - Creating an icon that runs a script file | DamienD | support.Other | 17 | 04 November 2016 02:06 |
How to make an Workbench Icon running a CLI Script ? | Marskilla | support.Other | 9 | 26 April 2016 23:11 |
Execute script works but not after adding an icon with IconX as Default Tool. | e5frog | support.Other | 19 | 27 July 2010 10:23 |
Can't open install script's icon | THX1138 | support.Apps | 14 | 01 July 2005 22:42 |
|
|