This is a small command-line program for OS X that assigns custom icons to Web Internet Location (
.webloc) files, displaying a thumbnail of the web page that they point to.
This is what the icons look like:
Here's the usage info of this program (run it without any arguments to see this):
If you'd like to have this program run automatically whenever you add
.webloc files somewhere (e.g. by dragging them from your web browser windows), you can do this in a number of ways. If you have a license to the Hazel application, that might be easiest, but other ways are folder actions (via Automator) and launch agents, which I'll explain below.
A launch agent is a configuration that tells the launchd system to do something (e.g. run
setWeblocThumb) when something happens (e.g. a file is added to a specific folder).
You can use
-a argument to generate launch agents that watch certain paths in your filesystem. For example, run the following command to have it run every time you add files onto your desktop:
setWeblocThumb -a ~/Desktop
You can use Automator to create a folder action that runs
setWeblocThumb whenever files are added to a particular folder.
- Open Automator and select the Folder Action template
- Select the folder you'd like to attach this action to from the combo box in the upper right-hand corner where it says "Folder Action receives files and folders added to"
- Drag the Run Shell Script action from the list in the left (it's under Utilities) to the action area on the right
- Select Pass input: as arguments in the action's settings
- Type the following into the shell script action's text field:
/usr/local/bin/setWeblocThumb "`dirname \"$1\"`"
February 04, 2012
- Implemented automated creation of launch agents that run
setWeblocThumbwhenever a certain path in the filesystem changes (e.g. whenever you drop
.weblocfiles into a specific folder). This is done using the
- Implemented listing of filesystem paths that are watched via launch agents (using the
- Dropped PowerPC support in the pre-built binary (I'm now using the XCode 4 dev tools, which do not support PowerPC anymore).
- Clarified the usage output a bit.