Mobile app version of vmapp.org
Login or Join

Login to follow query

More posts by @Sent7350415

1 Comments

Sorted by latest first Latest Oldest Best

 

@Tiffany317

This probably belongs on SU or SO, but since we're here, and it's vaguely design-related, here goes:

Since a .pal is a "sidecar" file, it only has to have the same name as the bitmap file it accompanies and be in the same directory. The fast way to do what you need would be to construct a simple script in Mac OS or Windows. There is no need to open the files at all.

The following instructions are for Windows, but the same procedure applies in Mac OS or Linux.


Dump a bare directory listing of the .cut (or whatever) bitmap files to a text file using dir /b *.* > listing.txt.
Open the resulting file in a text editor that supports regular expressions, such as Notepad++, and change all the (.cut or whatever) extensions to .pal.
If foo.pal is the master palette file, add copy foo.pal to be beginning of every line of listing.txt using a regular expression search and replace. Search for ^ (the start of any string) and replace with copy foo.pal to add the copy command to the start of every line all in one shot. This is why you want something like Notepad++ (or any text editor that supports grep).
Rename your listing.txt to listing.bat and execute it.


In Mac OS or Linux, the same general procedure applies, but in that case I'd probably pipe the ls output through sed using the same regular expression to get the executable in one shot.

In either case, do check the script file to make sure you got the command lines correct before you run it. It will save unnecessary deleting of bogus files!

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme