![]() |
![]() |
#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. |
![]() |
![]() |
#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"
|
![]() |
![]() |
#3 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
Thank you, it worked great.
|
![]() |
![]() |
#4 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,270
|
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
|
![]() |
![]() |
#5 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,326
|
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.
|
![]() |
![]() |
#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 |
|
![]() |
![]() |
#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.
|
![]() |
![]() |
#8 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 5,149
|
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" |
![]() |
![]() |
#9 | ||
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,270
|
Quote:
Quote:
[ Show youtube player ] Last edited by AMIGASYSTEM; 11 May 2018 at 01:37. |
||
![]() |
![]() |
#10 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,270
|
|
![]() |
![]() |
#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.
![]() |
![]() |
![]() |
#12 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 5,149
|
|
![]() |
![]() |
#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. |
|
![]() |
![]() |
#14 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,270
|
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. |
![]() |
![]() |
#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. |
![]() |
![]() |
#16 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,270
|
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.
![]() |
![]() |
![]() |
#17 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 5,149
|
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. |
![]() |
![]() |
#18 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,270
|
|
![]() |
![]() |
#19 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,415
|
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. |
![]() |
![]() |
#20 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,270
|
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 | |
![]() |
||||
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 |
|
|