19 April 12 / day 109 / 0 contributions

Labs Release: HTML5 Colour Space

Change the amount of colours in the colour space and travel through the spectrum.

21 March 12 / day 80 / 4 contributions

Re-designing the Aberystwyth University Webmail

NOTE: I took this project on myself and was not asked by Aberystwyth University to work on it. Aberystwyth university (at the time of writing this) has had no involvement in this project. Nor do they have anything todo with the views in this post or this post in general.


READ MORE…

15 January 12 / day 14 / 0 contributions

How to rename files from input in an Automator Workflow

Working with Hari’s little website can be slow some times with having to manually resize, rename and upload each file individually. So I decided the best route to take would be an Automator Workflow, nice and easy, so I thought.

Well, it turns out Automators default ‘Rename Files’ Action cannot accept a variable as an option to rename a file (EH?), I then went on the hunt for an alternative rename Action …. and failed. All the options gave me the same error.

In comes Applescript, a slightly less pretty option but it worked.

The solution I found was here  but I tweaked it ever so slightly so it worked to my liking, here is what I got.


on run {input, parameters}

	-- here the input is a reference to the file passed from the previous action
	set input to item 1 of input
	set defaultName to makeNewName()
	display dialog "Rename File To:" default answer defaultName buttons {"Rename", "Cancel"} default button "Rename" with icon note
	set newName to text returned of the result
	tell application "Finder"
		set ext to name extension of input
		set name of input to newName & "." & ext
	end tell
	return input
end run

to makeNewName()
	set root to "New Picture"
	set {year:y, month:m, day:d, time:t} to current date
	return root & " " & y & "-" & m * 1 & "-" & d & "_" & t
end makeNewName

12 December 11 / day 345 / 0 contributions

Hari is released

I’ve just open sourced a small project of mine called Hari. It’s a Content Management System with no database, so could be handy for people who don’t have database access or dont need a fully fledged CMS.
You can find the source code on https://github.com/matthojo/Hari