Create a custom folder
Once upon a time there was a programmer in Apple. He decided to make it difficult to implement Custom Folders by adding a CHR$(13) to the end of the file name, so that anyone trying to duplicate the file wouldn't see it. The file would look the same, but there's no way to see the other ascii character.
He eventually left Apple, and after passing time by ripping the wings off butterflies and studying Mein Kampf, ended up working for Microsoft. He is particularly proud of Windows 98.
Thank you, Deep. I added the CHR$(13) and my code now works perfectly. If anyone wants to create custom folders from within a program, I'll post the code.
This is the "ReadMe " file I've attached to the "CustomFolder.sit.hqx" file I've just uploaded to my Web site. You can download it from :
Hope it's of use. I've just kludged it together in about half an hour, and it's only been tested under 8.6.
If you wish to post this on other sites, please feel free to do so, but please put in a small credit to Hawk Software.
Creating a Custom Folder
The program adds the required functions to my "MiniBase" program, which you get as a bonus. I use "MiniBase" to test out new Functions, etc.
I needed to create a custom folder, which would contain a file containing information about the folder and its contents.
Thus the stages you need to go through are :
1. Create your custom folder Icons, and save them in your program's resource fork. It needs to be a resource of type "ICN#" (Icon family), and should contain all the sizes and masks). I've stored the example in ICN# 200, but you can number it anything you like, provided it's higher than 128, and doesn't interfere with your program ICN#s.
2. When you invoke the Menu, the program :
a) Invites you to name the file you'll be creating in the folder (you don't have to do this - you can change it if you want)
b) Creates a Folder with the same name
c) Creates the file
d) Creates an Icon File, and resource fork for it
e) Copies across all the "ICN#" resources from your own Resource Fork into the new file
f) Sets the Bit in the Folder to say that there's a custom Icon
g) Bumps the Folder date to update it
h) Sets the Icon file invisible. (This is commented out so you can see the file created while you're testing)
3. Using this method, you can have as many Custom folders as you like Ð just store them all in your program's resource fork, and set the Resource Number when you create the folder.
Thanks to those on the FB list who helped with this.