July 31, 2008, 15:20
There is a lot of nasty stuff to be said about velocity, but today I complain about it’s stupid whitespace-ridden syntax and it’s equally stupid error messages. I just got this one:
Parser Exception: templates/myoldtemplate.vm
Encountered "}" at line 19, column 101.
Was expecting one of: "," ... "}" ... ... ...
July 12, 2008, 23:48
Today I wrote a little class
that allows to repeatedly capture the screen content and write the result to a flash file.
It created a flash video with one frame per second (this is a bit crude) with one frame per screen shot taken. It is based on JavaSWF2 a nice wrapper around the SWF file format. To run you need to get the JavaSWF2 jarfile. Then you go:
camera = new ScreenCamera(new File("test.swf"));
doStuff();
camera.takeScreenShot();
doMoreStuff();
camera.takeScreenShot();
camera.close();
It might be useful for testing and creating tutorials.
July 12, 2008, 23:16
As it was a nice London day today – wind, rain, sunny spells and a cosy 15˚C all that, I spent the day with my Mac learning how to get more out of Quicksilver. I was wondering for some time how to implement my own actions. The task at hand was to have a single action that allows me to push files to the dropbox folder on my server out in the internet. So all this thing has to do is to create the right command line call. Unfortunately there is no way easy way just to add command using placeholders (or none that I am aware of).
So what you have to do to write an Actions is to write an AppleScript (which has a very idiosyncratic syntax, but feels a bit TCLee ) and put it into the right folder, something like /Users/USERNAME/Library/Application Support/Quicksilver/Actions/MyAction.scpt
So this is the thing I hacked up. It uses growl to notify the user, when the transfer is completed. Unfortunately it doesn’t display an error on failure. I would have to spend more time with AppleScript, but perhaps one of the readers comes up with a solution.
on open these_items
repeat with i from 1 to the count of these_items
set target to "user@host.com:/home/user/dropbox"
set filename to the quoted form ¬
of the POSIX path of (item i of these_items)
set theResult to ¬
do shell script "scp -q " & filename & " " & target
growl((filename & theResult))
end repeat
end open
on growl(theText)
tell application "GrowlHelperApp"
set the allNotificationsList to ¬
{"Test Notification", "Another Test Notification"}
set the enabledNotificationsList to ¬
{"Test Notification"}
register as application ¬
"Growl AppleScript Sample" all notifications allNotificationsList ¬
default notifications enabledNotificationsList ¬
icon of application "Script Editor"
notify with name ¬
"Test Notification" title ¬
"Drop done" description ¬
theText application name "Growl AppleScript Sample"
end tell
end growl
Useful links: QS wiki on scripting, QS google group
Verdict: QS rocks!
July 1, 2008, 23:59
Wenn sich der aktuelle Sprachtrend fortsetzt, wird man den Kindern in der Schule wohl bald sagen müsssen: “Päckchen mit Käse-Ä” – ganz analog zum Vogel-V. Interessant ist, dass die Rechtschreibung den umgekehrten Weg geht, z.B. aufwändig. Man könnte natürlich auch meinen, dass dies die schludrige Aussprache des Äs noch begünstigt.