Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Wednesday, April 20, 2005

Programmers Write Code; Brilliant Programmers Steal It

The process of inserting images into my blog entries are a rather tedious and repetitive endeavor. It has been so long since I have written html code, that I have usually navigated to one of my blog entries that had an image, then copied and pasted the code and changed the image URL.

There are a number of image hosting solutions available to bloggers. Windows users are able to use Hello BloggerBot, as well as a myriad of others. Mac users are able to use Flickr, which seems like a good free solution, but I often wonder about the bandwidth issues.

I have been using ImgSpot for my image hosting as it is a free service, there are no bandwidth restrictions, nor do you need a membership. ImgSpot seems to do everything I need it to do for the time being, though I may consider trying Flickr in the future.

Embedding the image file into html code is rather simple. The problem arises if you wish to wrap text around your image (as I like to do). This requires a number of extra html tags, and I always seem to forget the proper order in which to place the tags.

In the last few days, I surmised that since the order of the tags remain the same, and the only change in the code is the URL of the image file, I could write an Applescript that would insert the tags without me having to search my archives for the neccessary code. It seemed simple enough.

As I quickly learned, writing code is not for the novice programmer. Applescript is a language that is designed to closely resemble the English language, but even so, I can't seem to get the syntax right. Computers are rather unforgiving that way.

Then the 30-watt bulb that is covered in cobwebs went on inside my cranium. This was a rather simple script, I should be able to find one that will insert a default string of text within a text field. With some searching, I found the required code within a discussion group. All I had to do was change the parameters of the script, and recompile the code.

I'd much rather borrow code for my projects, rather than fight with computer syntax.

Now that the process of inserting images into this weblog has become a little simpler, I expect there will be an increased frequency of images in the future.