Posts Tagged ‘kindle’

I’ve been meaning to write a more geeky post for some time, and since I have nothing better to write at the moment, I thought I would take this opportunity to write about folder actions.

I’m going to assume that you can figure out the details of how to bend folder actions to your will. Or you at least know someone who can.  Often the hardest part of using a new technology is deciding what to do with it, so I’d like to share some ideas that I’ve found very useful.

The basic idea of folder actions is to trigger a script whenever one of the following “actions” take place:

  • adding folder items to
  • removing folder items from
  • opening folder
  • closing folder window for
  • moving folder window for

To be honest the only trigger I have used is adding folder items, which can of course be used to notify you when something is added to your Drop Box, or to perform some operations on downloaded files (e.g. move all pictures to ~/Pictures). But for me, the most useful has been taking action when a volume is mounted. This requires a little trick since the interface doesn’t allow you to attach a script to /Volumes. Firstcreate a symlink to:

ln -s /Volumes ~/vol-link

then start Folder Action Setup and add vol-link to the folders with actions list. You can then remove the symlink since Folder Action Setup follows it and will save /Volumes instead.

rm vol-link

I’m sure there’s a way to do the same thing by editing the plist files directly, but why bother?

Then you have to tell it what to do when a volume is mounted.  I use the following script (sorry there is no syntax highlighting) which simply finds the name of the volume, and runs a script (if it exists) named volumes - VOL_NAME.scpt saved in path to Folder Action scripts from local domain (you may prefer from user domain if don’t wish to share scripts with other users on the machine).

on adding folder items to this_folder after receiving these_items
	repeat with volume in these_items
		process_volume(volume as text)
	end repeat
end adding folder items to

on process_volume(vol)

	set short_name to (text 1 through -2 of vol) as text
	set script_name to "volumes - " & short_name & ".scpt"

	set FAS_folder to path to Folder Action scripts from local domain
	set full_path to (FAS_folder as text) & script_name

		run script (full_path as alias)
	end try

end process_volume

-- for testing
on run
end run

With this in place you will need something to do. I have two scripts volumes - GPOD.scpt and volumes - Kindle.scpt that I have found useful.  GPOD is the name of my iPod, and I have several mercurial repositories for configuration files, school work, etc. which are updated whenever I plug in my iPod. That way I always have the latest work with me wherever I go.

Perhaps more useful is the Kindle script. I have a folder where I drop things I want to put on my Kindle (this is especially handy since I don’t have whisper net here in Budapest with my pre-international Kindle 2). When a file is dropped in this folder, a folder action script (bet you didn’t see that one coming) looks at the extension.  If it’s directly readable on the Kindle it moves it to a holding folder, otherwise it will compose an email to Amazon to have it converted (I hardly ever use this now that the Kindle supports pdf) or throw an error if Amazon doesn’t know how to convert it. When the email comes back, another applescript should trigger off of a Mail rule to place it in the Kindle folder, but I never actually wrote that part. Then when the Kindle is attached, all files from the holding folder are copied to the Kindle and moved to a processed folder.

So, when I see something I want to read on the Kindle I simply put it in the Kindle folder knowing that the next time I plug in the Kindle it will automatically transferred.  It’s good to be lazy.  Now if only I had time to actually read everything that I have on the Kindle…

Read Full Post »


With the Kindle SDK soon to be out in beta, I’m hoping that someone will port TeX to run on the Kindle like River Valley Technology made TeX run on the iPhone.  Then I can finally have beautiful mathematics with resizing on the fly.  Seriously, watch the video if you are interested in this sort of thing–the demo is pretty neat.

The biggest drawback that I can see is that, in order to keep the display real time, it only supports basic TeX, not full blown LaTeX, and certainly not TikZ.  Though I have looked a few times in the past, I have never found anything to translate LaTeX to a simple (i.e. easy to render) TeX version by expanding all but builtin macros.  I did notice that version 0.0 of LuaTeX could print back to TeX which suggests it is fairly easy (if it doesn’t work out of the box).  If it were powerful enough (e.g. if you could specify which macros to expand), it could also be very useful to remove dependencies on packages or homegrown macros.

I feel slightly guilty blogging about this when I have homework to do, but it’s so exciting that I can’t stop thinking about it.  I hope that writing this post will help get it out of my system. :-)

Read Full Post »

Having been inspired by xkcd’s The Pursuit of Laziness, I can now truly enjoy reading in bed. This is something that has haunted me for years. I remember thinking as a kid that reading in bed should be less work than it is. There is simply no way to read comfortably in bed for more than a few minutes. One system that I came up with as a child was to place the book on the floor and hang my head over the edge. This of course tires your neck almost immediately, so I used to imagine a strap hanging from the ceiling to hold my forehead. I also wanted a bed with a hole cut out for my face to look through and see the book below, possibly with arm holes to turn the pages. Perhaps it’s best that I never implemented those ideas, because the problem has been solved. I can now experience perfectly comfortable reading in bed—except for that darn arthritic shoulder of course.

I took some pictures, but they didn’t really turn out too well. Since the pictures over at xkcd are much better, I will only include one here as proof that I have indeed created an Xtraordinary Kindle Cottage-made Decumbentifier. I’m now trying to figure out how to use decumbent in casual conversation.

My Kindle on it's XKCD

My Kindle on it's XKCD

The hanger I used has a blue plastic sheathe and plastic nubbins on the ends so it won’t scratch anything. However, the wire is pretty heavy and gave me and my little leatherman some difficulty. I would have really liked a vice or at least another pair of pliers. As a result my XKCD looks like it was made by a troop of boy scouts fighting over the pliers. But the important point is that I can now be lazy in comfort even if not style.

The beauty of the design is that it not only holds the Kindle up for you, but it gives you a convenient “button to push” to change the page. The only complaint I have is that it can’t lay at an angle. Usually my head isn’t completely parallel with the bed (because of the pillow), and it would be nice if the Kindle could be held at about a 10°. However, it has to work with the Kindle in both orientations (i.e. whether I’m laying on my right side or my left), which the current design does perfectly (thanks to a “next page” button on both sides of the Kindle).

Unfortunately, I still have the glasses problem. Laying on my side squishes my glasses into my head, thereby skewing the lenses and distorting the whole world. Perhaps I can take some old rags and make a Spectacle Stem Support System…

Read Full Post »