JavaScript

warning: Invalid argument supplied for foreach() in /home/wickamos/coffeeshopped/sites/all/themes/coffeeshopped3/template.php on line 74.

Applying our Photoshop Thumbnail Script to Multiple Documents • May 25, 2009

A reader asked if there was a way to apply the Photoshop Thumbnail script I wrote to all open documents, so I figured I'd post it up here for everyone to see. read more »

Using the YUI Autocomplete Control as a Combo Box • January 22, 2009

Yesterday I found this article showing how to add a button to the Yahoo UI Autocomplete Control to make it behave like a combo box (i.e. all of the autocomplete's suggestions are listed in a dropdown when the button is clicked).

I was working on doing exactly this before I found the article, but had run into some buggy behavior in my implementation. I was doing it basically the same way this article suggests, having the button call the Autocomplete's sendQuery() method, passing it an empty string. But the button would only work the first time it was clicked; after that, clicking the button would return no results in the Autocomplete.

What this article pointed out to me is that the input element for the Autocomplete should have focus before you call sendQuery(), to ensure the query results in the dropdown being populated. This behavior certainly seems like a bug to me. read more »

Thumbnail Generation with Photoshop and JavaScript • December 15, 2008

A couple of weeks ago I wrote a post called Conditional Image Resizing with Photoshop and JavaScript that illustrated how to write a script to perform quick photo cleanup and resizing within a bounded area. Today I want to talk about a similar technique for generating thumbnail images. The fundamentals are the same, but the goal is slightly different. read more »

Conditional Image Resizing with Photoshop and JavaScript • November 28, 2008

Often I find myself having to do a lot of bulk image processing when I'm working on websites: resizing a bunch of pictures to a certain width or height, color adjustments, and sharpening, usually. It can be the most mind-numbing part of my work, and I'm always looking for ways to avoid that.

In Photoshop, you can use actions to help you automate a lot of repetitive work. However, the shortcoming I've found with actions is their lack of conditional behavior. For example, let's say I have a big batch of images, some portrait-oriented (taller than they are wide) and some landscape-oriented (vice versa), and I want to resize each of them to fit within a 500 x 500 pixel square. If the image is portrait-oriented, then I need to resize proportionally, setting the height to 500 pixels. If it's landscape-oriented, then I should resize proportionally with a 500 pixel width, instead of height. I've never found a good way to do this with a single action. But where actions fail, JavaScript comes to the rescue. read more »

Syndicate content