Showing posts with label AppleScript. Show all posts
Showing posts with label AppleScript. Show all posts

Monday, December 10, 2007

Been A While

It has indeed been a while. Just a quick post, because I thought I should actually contribute things here more often, and also thought I had something useful that other people might borrow and extend for free.



What I've written is a quick little AppleScript script that takes your currently selected text file, and "un-gutenbergizes" it. What I mean is that it removes all those senseless newlines they put into Project Gutenberg ebooks, and gives you back a text file with paragraphs that actually wrap! It's the only practical way to view ebooks on my new iPod Touch and/or Tofu on my Mac, which is an excellent text viewer and "columnifier". I've read entire books with my macbook sitting on my chest, lying down in bed, with Tofu. I think it's truly the next gen of readable ebooks, and we need an iPod/iPhone port!



For those interested in actually using the script, there are caveats since I don't really USE applescript (more on that next time!). First of all, it has a giant bug that means you must run it "indirectly". It only works if you select your file, then run it from your scripts menu on the menu bar. Double-clicking on the script file app itself and/or just dragging your text file to it does not work. Don't know why. Also, you WILL need TextWrangler installed, as that is how I automagically replace \n's with spaces and keep \n\n's the same.



As for a bullet-proof, drag-and-drop, stand-alone Cocoa app that does the right thing, that is coming soon enough. It really won't be much more coding than I used in the AppleScript, but it's more time than I have in between exam studying-periods. I wish they made a C-syntax language that let you use all the scripting hooks; I HATE AppleScript! Oh wait, they put that in Leopard with the beautiful, beautiful scripting bridge. I officially [heart] Leopard just for that! Oh, and free garbage collection too!



Also I just realized that there's no actual way to upload real FILES to a blogger.com blog, so let's just pretend I never offered a buggy AppleScript app in the first place, kay? A real developer (such as yours truly) wouldn't do that! So until I write the new code (and find a free host for my files), enjoy some nerdy science lolcats.

Monday, August 13, 2007

Actual Programming!


Ok, so It's been just over a week since I began this blog. What have I accomplished? Well, I've gotten over a cold, learned that peaches and cinnamon were made exclusively for inclusion in chicken pot pies, and finally broke out my copy of Aaron Hillegass' Cocoa Programming for Mac OS X to continue learning the beauty that is Cocoa.



I've had quite a long sabbatical from this standard Cocoa beginner's tool, but I'm finally making my way through Chapter 7 and figuring out the Undo Manager. Woohoo! Now that I'm back on the train, I'll start fleshing out my current projects. One is going to be a dead simple, elegant and FREE money manager. Nothing to replace the more advanced programs out there, but enough to quit using a friggin spreadsheet! This project was born out of my frustration of, well, using a spreadsheet. The second project is a bit neater, and uses a slightly more diverse set of tools to get its job done.



It's a text-to-speech converter, mainly for converting ebooks into audiobooks that I can listen to on my iPod. The beauty is its integration with iTunes, using a bit of AppleScript to automatically tag the files and convert them into a low bitrate. My next step is to rework the splitting algorithm, which was initially "borrowed" from Matthew Russell's DIY iPod eDoc Reader Tutorial posted on the O'Reilly Mac DevCenter site. Finally, I hope to unravel iTunes' inner workings to add these files to the Audiobooks section of the iTunes library. Someday, I may even extend this program to read RSS feeds and sync new ones to an iPod as a podcast.



That's all for today, cheers.