Mass replace files of same file type

8ball Community Member Posts: 35
I commonly have to take Lectora files that other developers have completed and perform various optimizations on the file due to:Using the wrong types of images, such as png or bmp instead of gif or jpgsUsing the wrong types of audio files, such as wav instead of mp3In order to fix the title, you can either individually convert each item to the proper file extension and import and replace them in the Lectora file, but this is very time consuming, and will drive you crazy.The more efficient way is to perform a mass update in the Lectora file to update the file types. This update only changes the file extension, but keeps the original file names associated with the files. To do this I am using the example of bmp to gif.The default location that the bmp files would be stored at is the "images" folder in the same directory as your Lectora awt file. I would first recommend backing the Lectora awt file and the images folder up before making any modifications.Begin by taking all the bmp files you want to convert that are in the images folder and running them through a batch conversion program to convert them to the right filetype. In this example I want to convert bmp images to gif. The program I use is Photoshop to do this. I run them though an action that saves the bmps to gifs and compresses them a certain way. (I have tried using the compression settings in the latest version of Lectora, but I find I can get better results using Photoshop)After saving the bmps to gifs, I then open the Lectora awt file and export the title to a XML file.I then open the XML file using Dreamweaver and perform a Find and Replace on everything that has a ".bmp" file extension and replace it with ".gif" (This assumes that your title has no other bmp images that are being used)After all are replaced, I import the XML file back into the Lectora awt file, and all the bmp resources are now updated to gifThis also would work for other file extensions that you would have to update on a mass scale.Edited By: 8ball on 2009-1-6 15:36:50
Sign In or Register to comment.

So You Wanna Be An eLearning ROCKSTAR?

We're all fans of eLearning here! Want to become an eLearning ROCKSTAR? Just click on one of the buttons below to start your rocking journey!