Iconset Maker (Updated)

Iconset Maker

updated : 11/07/2024
xml utf encoding fix

updated : 5/2/2024

  • iconified
  • dpi scaling added
  • refactored
    see end of post for download
    old version is V12 compatible, new version is V13

For creating Directory Opus .dis icon sets

INSTRUCTIONS
Step 0 : Add the .dis extension to Preferences/Zip Files - Zip file extensions.

Step 1 : Install the button (old) or script (new) at the end of this post – see (How to use buttons and scripts from this forum)

Step 2: You need to put your icon-set folders somewhere, so make a folder and call it something like ‘My Directory Opus Iconsets’.

Step 3: In this folder make another folder and call it something like ‘My first Directory Opus Iconset’.

Step 4: Put ‘montage.exe’ in your icon set folder (See end of post on how to get it) OR place montage somewhere else and put the path to it in script preferences.

Montage is a free small executable used to scale and stitch images into the two ‘icon sheets’ that Directory Opus will use for large and small icons. It is part of the suite of programs that come with Imagemagick.

Step 5: Put some images in this folder.
-only PNG images will be processed.
-Directory Opus has a ‘convert image’ button on the standard image toolbar.
-there is usually a convert ‘image option’ in the right-click context menu.
-the images can be any size and shape, square is best for icons.
-the results of scaling are better when scaling larger images to smaller images.
-you can drag & drop images directly from the browser.

Step 6: Name the images, the filenames will be used as the internal names for the icons,
If you want the icons to automatically change then the new icon needs to have the same name as the old icons internal name (the name in brackets when hovering over an icon in the icon selection dialog) AND the icon set needs to be above the old icon-set.
image

Step 7: Launch Iconset Maker, fill in the details, press OK.

When finished the .dis icon-set file will be in a newly created sub-folder, named something like ‘My first iconset (24px & 32px)’ and can now be installed from Preferences/Toolbars/Icons and clicking the ‘Import’ icon at the top of the list.

The folders are named this way so that you can have the same icon-set in different sizes.

Selecting a sub-folder before clicking the button will fill in the name and icon sizes in the dialog, otherwise the details will be remembered from your last session.

Directory Opus uses 2 icon sizes, when making iconsets it is best to keep one of the sizes (small) at around 22px so that your new icons can blend in with the default context menu icons. The image shows some possible combinations and the original icons for comparison.

Montage.exe
Download latest Imagemagick portable from the imagemagick website The portables are at the bottom of the page.
Extract montage.exe from the portable.

Or

UPDATE:
more recent version from 'ImageMagick-7.1.1-23-portable-Q8-x64'
montage.zip (9.2 MB)

The V12 button is here
Iconset Maker V2.dcf (42.6 KB)

Updated: V13 version is a script.
Install into scripts - see (How to use buttons and scripts from this forum) and make a button with the command IconsetMaker
Iconset Maker.opusscriptinstall (209.6 KB)

update: 02/03/2024 (now works in libraries)
Iconset Maker.opusscriptinstall (209.6 KB)

update: 11/07/2024 (utf encoding fix)
Iconset Maker.opusscriptinstall (209.7 KB)

Enjoy

10 Likes

Thankyou very much.
Your script works just great !
It is good to be able to make joined image icon sets so quickly and easily.
Iconset
Large_40px

1 Like

Thanks works great!

Clear documentation and a time and space saver of a script. Thank you!


image

Error:

 02/03/2024 10:14 Iconset Maker:  Error at line 670, position 5
 02/03/2024 10:14 Iconset Maker:  Bad file name or number (0x800a0034)

No idea how to actually have log()'s print to the help -> log window, so can't debug this myself.

Go to Settings > Scripts... then select the Iconset Maker and Ctrl+G is the shortcut to open its config settings and enable the Logging option there.

1 Like
  xmlArray = xmlArray.join('\n');
    log('xmlArray created', '#4455ff');
    log('   ', '#4455ff');
    
    // WRITE XML TO FILE
    var fso = new ActiveXObject('Scripting.FileSystemObject');
    var a = fso.CreateTextFile(newSubFolder + '\\Iconset.xml', true, true);
    a.WriteLine(xmlArray);
    a.Close();

seems to be having trouble writing the xml. Working OK here. What steps are you taking so I can reproduce. What Windows version are you using (should not matter, but was made on Windows 10, not tested on Windows 11)

I'm just using it as normal as you may expect. Nothing outside your steps.

Log:

 02/03/2024 15:10 Iconset Maker:  Iconset Maker
 02/03/2024 15:10 Iconset Maker:  No err
 02/03/2024 15:10 Iconset Maker:  No err
 02/03/2024 15:10 Iconset Maker:  No err
 02/03/2024 15:10 Iconset Maker:  No err
 02/03/2024 15:10 Iconset Maker:  No err
 02/03/2024 15:10 Iconset Maker:  No err
 02/03/2024 15:10 Iconset Maker:  No err
 02/03/2024 15:10 Iconset Maker:  No err
 02/03/2024 15:10 Iconset Maker:  No err
 02/03/2024 15:10 Iconset Maker:  No err
 02/03/2024 15:10 Iconset Maker:  No err
 02/03/2024 15:10 Iconset Maker:  OK pressed
 02/03/2024 15:10 Iconset Maker:  ****************************
 02/03/2024 15:10 Iconset Maker:  name = 		aa
 02/03/2024 15:10 Iconset Maker:  Large = 		32
 02/03/2024 15:10 Iconset Maker:  Small = 		22
 02/03/2024 15:10 Iconset Maker:  DPI = 		100
 02/03/2024 15:10 Iconset Maker:  artist = 		Various
 02/03/2024 15:10 Iconset Maker:  copyright = 	© 2024
 02/03/2024 15:10 Iconset Maker:  ****************************
 02/03/2024 15:10 Iconset Maker:  Sub-Folder = 	EXISTS
 02/03/2024 15:10 Iconset Maker:  folderpath = 	lib://Documents/?54bddd4c/Directory Opus Icon Sets/KDE Breeze
 02/03/2024 15:10 Iconset Maker:  foldername = 	aa (32px & 22px)
 02/03/2024 15:10 Iconset Maker:  ****************************
 02/03/2024 15:10 Iconset Maker:  ****Delete "lib://Documents/?54bddd4c/Directory Opus Icon Sets/KDE Breeze\aa (32px & 22px)" QUIET
 02/03/2024 15:10 Iconset Maker:  ****CreateFolder NAME="lib://Documents/?54bddd4c/Directory Opus Icon Sets/KDE Breeze\aa (32px & 22px)"
 02/03/2024 15:10 Iconset Maker:    
 02/03/2024 15:10 Iconset Maker:  Large_32px.png
 02/03/2024 15:10 Iconset Maker:  Small_22px.png
 02/03/2024 15:10 Iconset Maker:    
 02/03/2024 15:10 Iconset Maker:  xmlArray created
 02/03/2024 15:10 Iconset Maker:     
 02/03/2024 15:10 Iconset Maker:  Error at line 670, position 5
 02/03/2024 15:10 Iconset Maker:  Bad file name or number (0x800a0034)

I can only presume it's the fact that Directory Opus is providing lib://Documents instead of C:/Users/user/Documents. It's the ONE thing I don't like about Directory Opus. I so wish they would just give an option to resolve as the actual path, globally, especially in the location bar.

The actual path isn't the same thing as the library path, so that would not make sense at all. If you want the actual path, go to it instead of the library.

Within the script, you can using FSUtil.Resolve to get the real directory for a given path. The script just needs to use that before creating the file.

Okay, many thanks for input, have posted update in OP, should work in Libraries now.

1 Like

I am getting an error alarm as shown below, what is the reason?

image

Have tried to reproduce the error but cannot.
All I can suggest is to try making the iconsets in a different folder.

I get this error no matter where I put it, maybe it's a problem with my system, this script used to work fine.

Please try the previous version, still posted above in Original Post and see if the issues persists.

I understand that, but I personally like to perceive the Libraries in the tree as glorified and organised bookmarks to directories (considering my Libraries only ever have one location). I totally understand why it's like this, but I would personally prefer to have the libraries in the tree resolve to their actual path.

Like, for my use case as a developer it's very annoying to copy the current folders location from the location path instead I have to go back out the folder, right click it, copy as path.

That isn’t what libraries are for, and they don’t have a single real path; they have several. Also not how they work in File Explorer.

They can have several, but none of mine do. Is there really no way to have the location bar always resolve the actual path we are in? That's basically my only gripe.

Working perfect now btw, thanks

Unfortunately, I still get the same error as before after running the script on another brand new Win11 system. It's very confusing.