OS/2, eCS & ArcaOS - Technical > Utilities

Color labels

(1/3) > >>

Devid:
Hi
there is a way to label (for example with a color) or mark (with an icon/image) a file like Mac does?
Maybe reading/setting a sort of EA?

For example on XFCE (linux) I wrote a little shell script (in the popup menu) that mark the file icon.
Is it possible with AOS?

D.

xynixme:

--- Quote from: Devid on October 12, 2019, 11:47:28 pm ---a way to label (for example with a color) or mark (with an icon/image) a file like Mac does?
Maybe reading/setting a sort of EA?
--- End quote ---

I'm not aware of what a Mac does nor what it looks like, but you can use a file type to set an icon if the file name has no fixed pattern. You may need something in the middle to assign the right marked icon.

I can create a "PDF file" called "C:\I_hate_file_extensions!!!" with a PDF icon because of the file type (EA), but I'll need something extra to change the file type to "Printed PDF file" with a matching marked PDF icon later. Without using CGI to modify and replace an existing icon, that is.

Laurence Pithie:
You can set a file's icon with the SysSetIcon function in the RexxUtil library. Just feed it the file name and the icon file name. The WPS can be a bit picky about the format of the icon though, if it isn't happy it will display the default icon instead of the new one. The details of the format can be found in the Control Program Guide in the toolkit information.

xynixme:

--- Quote from: Laurence Pithie on October 14, 2019, 02:52:09 am ---You can set a file's icon with the SysSetIcon function in the RexxUtil library.
--- End quote ---

He should be able to do that with OO.EXE, which may avoid or postpone a REXX.DLL crash. Setup string "ICONFILE=C:\FOO\BAR.ICO". A disadvantage can be that the original icon may be unknown. He wants to "mark" an existing icon, so this will only work if the existing icon is known and BAR.ICO is its marked version.

For example, you can assign the file type ScanMe to all files in a folder, and associate those ScanMe files with a VIR-SCAN.CMD file (and its matching VIR-SCAN.ICO file). Let VIR-SCAN.CMD scan the files and change the file's type from ScanMe to MarkAsScanned (or delete the file type EA, to restore an original icon). Untested and FWIW.

xynixme:
An untested and modified existing sample of a part of the .type EA route, FWIW, with one added line:


--- Code: ---/* REXX SetType.cmd */
/* only used during installation */
call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
call SysLoadFuncs
parse arg fn

if left (fn,1)='"' then parse var fn '"' fn '"' .

/* set Sudoku .TYPE EA for the file */
type = 'Sudoku'
typeEA = 'DFFF00000100FDFF'x || d2c( length( type ) ) || '00'x || type
call SysPutEA fn, '.TYPE', typeEA
exit
--- End code ---

Associate the type with a single executable-file-with-an-own-icon, e.g. a SUDOKU.EXE.

Next associate the type with data files, like unsolved puzzles.

Finally create a SOLVED.CMD file with a SOLVED.ICO file, which changes the type of a data file from "Sudoku" to "SolvedPuzzle", with an icon which looks like a marked icon of SUDOKU.EXE.

Navigation

[0] Message Index

[#] Next page

Go to full version