24 August 2020, 21:09 | #1 |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 962
|
IconX - read tool types from script?
Is it possible to read use tool types to pass arguments to a script run through IconX?
|
24 August 2020, 21:59 | #2 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
|
You could make an example, excuse me but the translation did not make me understand what you asked for
|
24 August 2020, 22:51 | #3 |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 962
|
Yes sure. Imagine two files; Hello.info and Hello where Hello.info is the icon of type Project with Default Tool set to IconX and has a Tool Types entry MSG=Hello,World. From the Hello script I would like to print the value of MSG as set up in Tool Types. Is this possible? (similar to command line arguments to a program).
|
24 August 2020, 23:07 | #4 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
|
IconX runs "Hello" through the "Execute" command and I don't know if this command supports this kind of message.
If you want to run the icon from a Shell instead you could use "WBRun" this command also supports the parameters included in the Tooltype |
25 August 2020, 09:23 | #5 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
This is for running a WB program from CLI, but what the OP wants is the opposite : running a CLI program from WB. |
|
25 August 2020, 10:05 | #6 | |
CON: artist
Join Date: Feb 2006
Location: Poland
Age: 43
Posts: 1,250
|
Quote:
That's pretty much it. Iconx has some tool types but nothing for arguments. You can check out CliCon for more features. |
|
25 August 2020, 11:07 | #7 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
I think what you need is a tool (should exists if I remember right) that can read tooltypes from icon files. If the script is in ARexx you can use rexxtricks.library for example that can handle tooltypes.
Haven't tried but there could be a problem left. The icon file might be locked during execution and therefore no access to it. But try it. |
25 August 2020, 12:42 | #8 |
Registered User
Join Date: Oct 2013
Location: England
Posts: 419
|
http://m68k.aminet.net/package/util/cli/ViewT
I found that, haven't tried it myself however. I wonder if those old IconX type programs have it in, like IconJ and XIcon, and I think there's another but you never know, they may have what you want? Worth checking out. Edit: I've just tried the ViewT and it does work, it lists the tooltypes but it numbers the lines too starting from 1. , it puts the number followed by a fullstop followed by a space and then the tooltype. You could use a script to modify and get clean output if required or try and alter the program itself as the C source is included. It has a DEL option, don't use that as it erases the line number of the tooltype you enter so be careful! Last edited by paul1981; 25 August 2020 at 13:09. |
25 August 2020, 13:04 | #9 | |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
|
Quote:
But this can be done safely if you have an updated OS (3.5/3.9) Last edited by AMIGASYSTEM; 02 October 2020 at 18:21. |
|
25 August 2020, 13:40 | #10 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
You don't need an updated OS to just run a cli program from wb, even with arguments, but this is not the point. The point is to pass icon tooltypes to the cli program (in a way it can understand).
|
25 August 2020, 14:02 | #11 |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
|
Icon.library offers the functions FindToolType() and MatchToolValue(), and with Arexx it should be possible to open any library of the system and use its functions, if I remember that correctly, but I'm not an Arexx user or expert.
Code:
NAME FindToolType - find the value of a ToolType variable. SYNOPSIS value = FindToolType(toolTypeArray, typeName) D0 A0 A1 STRPTR FindToolType(STRPTR *, STRPTR); FUNCTION This function searches a tool type array for a given entry, and returns a pointer to that entry. This is useful for finding standard tool type variables. The returned value is not a new copy of the string but is only a pointer to the part of the string after typeName. INPUTS toolTypeArray -- an array of strings (STRPTR *). typeName -- the name of the tooltype entry (STRPTR). RESULTS value -- a pointer to a string that is the value bound to typeName, or NULL if typeName is not in the toolTypeArray. EXAMPLE Assume the tool type array has two strings in it: "FILETYPE=text" "TEMPDIR=:t" FindToolType( toolTypeArray, "FILETYPE" ) returns "text" FindToolType( toolTypeArray, "filetype" ) returns "text" FindToolType( toolTypeArray, "TEMPDIR" ) returns ":t" FindToolType( toolTypeArray, "MAXSIZE" ) returns NULL FindToolType( toolTypeArray, "text" ) returns NULL FindToolType( toolTypeArray, ":t" ) returns NULL NOTES icon.library V44 tolerates tool type strings with additional blanks around the '=' character, such as in "FILETYPE = text". Older icon.library versions did not support this. SEE ALSO icon.library/MatchToolValue NAME MatchToolValue - check a tool type variable for a particular value. SYNOPSIS result = MatchToolValue(typeString, value) D0 A0 A1 BOOL MatchToolValue(STRPTR, STRPTR); FUNCTION MatchToolValue is useful for parsing a tool type value for a known value. It knows how to parse the syntax for a tool type value (in particular, it knows that '|' separates alternate values). Note that the parsing is case insensitive. INPUTS typeString -- a ToolType value (as returned by FindToolType) value -- you are interested if value appears in typeString RESULTS result -- TRUE if the value was in typeString else FALSE. EXAMPLE Assume there are two type strings: type1 = "text" type2 = "a|b|c" MatchToolValue( type1, "text" ) returns TRUE MatchToolValue( type1, "TEXT" ) returns TRUE MatchToolValue( type1, "data" ) returns FALSE MatchToolValue( type2, "a" ) returns TRUE MatchToolValue( type2, "b" ) returns TRUE MatchToolValue( type2, "d" ) returns FALSE MatchToolValue( type2, "a|b" ) returns FALSE NOTES icon.library V44 skips blank spaces surrounding the typeString options and the value string. Older icon.library versions did not support this. SEE ALSO icon.library/FindToolType utility.library/Stricmp |
25 August 2020, 19:46 | #12 | |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
Quote:
That's why the openlib function of ARexx requires an offset argument. It's the offset of the special funtion. |
|
25 August 2020, 20:52 | #13 |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
|
Sorry, it was more than 20 years ago when I wrote my last Arexx scripts and at that time I still had a big Arexx manual from OS 2.x, but I don't have that anymore and my memories are lossy, so maybe I'm wrong ...
Update: I can't remember anymore what I once used to get access to library functions with Arexx, but there are several solutions available on Aminet, even for reading icon tooltypes. Try some of the following examples ... http://aminet.net/package/util/libs/rxwb http://aminet.net/package/util/rexx/rmh http://aminet.net/package/util/rexx/royalbridge11 http://aminet.net/package/util/rexx/Rxgen Last edited by PeterK; 25 August 2020 at 22:26. |
26 August 2020, 00:54 | #14 |
Zone Friend
Join Date: Apr 2005
Location: London
Posts: 1,176
|
Have a look at TTtool on Aminet
http://aminet.net/package/util/batch/TTTool This will read the default tool and the tooltypes from an icon. Last edited by rare_j; 31 August 2020 at 13:04. |
26 August 2020, 09:12 | #15 | |
Registered User
Join Date: Oct 2013
Location: England
Posts: 419
|
Quote:
|
|
26 August 2020, 10:37 | #16 |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 962
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help with icons and tool types | MartinW | support.Other | 3 | 12 December 2018 15:16 |
Script to update tool types of slaves for quit key? | emuola | project.WHDLoad | 17 | 15 March 2017 18:26 |
Tool Types disappearing | XimeR | project.WHDLoad | 6 | 29 July 2014 15:45 |
How to change default tool for file types | AndyFC | project.ClassicWB | 2 | 13 February 2013 10:18 |
Execute script works but not after adding an icon with IconX as Default Tool. | e5frog | support.Other | 19 | 27 July 2010 10:23 |
|
|