I made a bit of a mistake while writing Wallsaver 2.0.
Most people (unless they add third party screen savers) don’t have anything inside the “/Library/Screen Savers” or “~/Library/Screen Savers” folders. Because of a bug in the code (details below), a lot of people were given the following error:
Can’t make every file of «class ects» of alias "Macintosh HD:Library:Screen Savers:" into type «class alst». (-1700)
In the program, there’s a bit of code that adds all the screen savers in a folder to a list. The code will run if the folder is empty or even if the folder doesn’t exist.
The bad code:
set UserScreenSavers to (files of entire contents of UserScreenSaversPath) as alias list
The fix, as you can see, is quite simple. Simply throw the offending code into a try statement. If any part fails (i.e., the folder is empty or doesn’t exist), set the list to null.
The better code:
try
set UserScreenSavers to (files of entire contents of UserScreenSaversPath) as alias list
on error
set UserScreenSavers to {}
end try
Why didn’t I put in the try block from the beginning? On both of the computers I use to test software (yes, I do test my software), all three of the directories Wallsaver searches in for screen savers exist and have files in them. There was just no opportunity for the list population to fail.
Thank you to all the users of Wallsaver who quickly downloaded (some within 2 hours of the release) v2.0 and reported the bug. Your efforts helped in the v2.1 update being released as quickly as it did.



Recent Comments