Showing posts with label genius me. Show all posts
Showing posts with label genius me. Show all posts

08 June 2009

Applescript for Journler: puts Contacts in Comments

Ok, now I'm just being annoying. I didn't want to be mucking around with Applescript at all, but Journler is so cool and so useful that I just can't help myself. With just a few little scripty tweaks, I'm able to use it as my dream PIM (that's a personal information manager for those of you who aren't annoying).

[p.s. Did you know that when you hover over the date of an entry in the browser list for a few seconds, the tip will show the amount of time that has elapsed since the date of the entry? So hover over 9/8/08 a few seconds, and underneath the tip showing "~ 8 months 4 weeks and 2 days ago". That is so cool! Make your savant computer slave calculate for you!]

Anyway, I used the script from my last post to import a bunch of iCal entries for meetings that I've had, each with one attached contact. In Journler, I needed to be able to see a list of all those meetings, see the date, see the topic of the meeting in the title, and also see the contacts so that I could see at a glance when I last saw who in comparison to everyone else. Because the contacts/resources have a many-to-one relationship to the entries, they aren't easily listed in the grid view. The entry Comments to the rescue!

This script makes a list of all the contacts names and copies it to the comments column, which can then be shows in the grid list and sorted on and so forth. Voila (hey, those French lessons are coming in handy, too).

All warnings apply; again, this was quick and dirty scripting.

-- place in ~/Library/Scripts/Journler
-- Copies selected entry's contact resources to comments
- Created by Courtney Lamb 6/7/09 (www.courtneylamb.com)
-- Use at your own risk!
tell application "Journler"
set theEntriesList to selected entries
repeat with theEntry in theEntriesList
set theNames to ""
repeat with theResource in resources of theEntry

if type of theResource is contact then
if theNames is not "" then
set theNames to theNames & ", " & name of theResource
else
set theNames to name of theResource
end if
end if

end repeat
set comments of theEntry to theNames
end repeat
end tell

04 June 2009

Applescript to create Journler entries from all events in an iCal calendar

I searched long and hard on the you-know-what to find some nerd who had already done what I needed to do -- "import" all of my iCal events in a certain Calendar into Journler as events, also attaching the iCal event attendee to the Journler entry as a Contacts resource.

Surely someone else had done this already! I don't have to muck around with programming/scripting anymore, do I? I don't have to learn AppleScript all of a sudden; I mean, I'm sick of this shit, we're supposed to have robot servants to do things like this for us by now!

So I had to be my own nerd, and if you are the me of yesterday and are looking for a script to do this, you are welcome. Just use it at your own risk because I learned as little about AppleScript as I possibly could in order to throw this together and resented it every step of the way and wasn't careful with error handling and all that mess.

But it totally works! As a reference, I converted 158 entries this way with no problem, took a few minutes. I knew my mysterious past in data conversion would pay off some day.


-- place in ~/Library/Scripts/Journler
-- Creates Journler entries from all iCal events in the calendar named "Journler Drop" (copy desired events here)
-- Sets a tag of "iCal" to the Journler entry
-- In addition, if there is an attendee on the iCal event (just the last attendee, if there are multiple), it attaches a Contacts Resource to the Journler entry
-- Created by Courtney Lamb 6/4/09 (www.courtneylamb.com)
-- Use at your own risk!

tell application "iCal"
tell calendar "Journler Drop"
set theCount to count of events
-- Loop through all of the iCal events in the given calendar
repeat with j from 1 to theCount
set theEvent to item j of events
set theSummary to summary of theEvent
set theDate to start date of theEvent

-- Put both the iCal description and location in the Journler notes
set theNotes to ""
set theLocation to ""

if exists (description of theEvent) then
set theNotes to description of theEvent
else
set theNotes to ""
end if
if exists (location of theEvent) then
set theLocation to location of theEvent
else
set theLocation to ""
end if

-- Get only the last of the attendees, if any
set theContactID to ""
if exists (the last attendee of theEvent) then
set theName to display name of the last attendee of theEvent
tell application "Address Book"
if exists (the first person whose organization = theName) then
set thePerson to (the first person whose organization = theName)
set theContactID to id of thePerson
else
set theContactID to ""
end if
end tell
end if

-- Create the Journler entry
set theNewTag to {"iCal"}
set theCategory to "Contacts"
tell application "Journler"
set anEntry to make new entry
set the name of anEntry to theSummary
set the date created of anEntry to theDate
set the tags of anEntry to theNewTag
set the category of anEntry to theCategory
set the rich text of anEntry to theLocation & "
" & theNotes
-- Create the attached Contact resource from the iCal attendee
if theContactID is not "" then
set aResource to make new resource with properties {owner:anEntry, type:contact, contact id:theContactID}
end if
end tell
end repeat
end tell
end tell


16 February 2008

Hello, Johns Hopkins. I have established a website.

So let's say you went to college, and your college has an Alumni Notes section in its fancy magazine that gets mailed to all alumni four times a year. Your former classmates send in announcements like "I now run the largest trauma center in the Milky Way," or "I just published my fourth Pulitzer-winning book," or perhaps "My wife and I just had triplets, which was hard to fit in to our busy schedules as justices on the Supreme Court."

Now let's say you are me. You vaguely remember receiving a card from school mentioning a reunion or homecoming or something. It had a place for you to write an update about how you just saved Asia from a meteor with your amazing physicist powers or whatever. It also had places to update basic contact info like your address and phone number.

So you scribbled in your eponymous website address, assuming that it would go into an alumni contact database or a list or something somewhere.

But you just got your fancy alumni magazine in the mail, and some helpful soul assumed that your scribbled website address was intended to be an important announcement about your life, one that you'd love to share with your fellow alumni. And this helpful soul, who maybe is a little bit evil, constructed a sentence around your url: "Courtney Lamb has established a website," and printed this sentence in the Alumni Notes.

Yes, Hopkins community. I have established a website.

It was a mighty task, but it's the kind that the rigorous Johns Hopkins University curriculum prepared me for. I am so proud. I only wish I had even more photos of me looking utterly goofy on said website.

I needed to share www.courtneylamb.com with those of you announcing job changes, marriages, birthings, and elections to the Senate. Each of us has done something life-changing.

I Have Established a Website. BEHOLD.

If you send me your phone number, I can call you every time I do something this important. You need to know.

I promise to keep my fellow JHU alumni updated on future important info, such as my favorite color (leaning towards eggshell white these days) and the hilarious antics of my cats. JHU: I have already filled out alumni notes cards with this important info; stand watch for the mailman.

YOU'RE WELCOME.

18 July 2007

Dr. Genius and Mrs. Hunh? -- the G4 sleeps tonight

I think I might be a genius, which is a good thing because I need someone around to clean up after the boneheaded mistakes I make.

For instance (and this one gets blamed on both me and Mr. Hunh), we lived in our current house for a year using rabbit ears and watching fuzzy TV before we finally wondered, "Hey, what's that plug in the wall behind the TV for? And why's there a big antenna on the roof -- it doesn't even give us good reception!" When we finally attached a cable from the plug to the TV...hey, look! That antenna works after all!

That's the "What's That Thing?" conundrum that keeps biting us -- we'll notice something we can't explain and then shrug and fail to investigate it for a few years. We're busy, people, we can't be opening drawers in our own house unless it's absolutely necessary. So, What's That Thing that looks like a latch on the utensils basket in the dishwasher? Five years later, we push the latch and realize that it flips the basket open so you don't have to scrape your hands when you unload the utensils. Wow, that's so much easier! I'm a genius!

So my desktop MAC (a G4 -- if you care about these things, start scoffing about not having thousands of dollars to upgrade to a G5 for no reason...NOW. Done scoffing? Feel better? Ok.) had a little problem. The power was wonky, so the USB ports on the back of my monitor stopped working a year or eighteen months into my ownership of the unit, and the USB and firewire ports on the tower eventually became so unreliable that I had to buy new slots and install them, and the computer wouldn't sleep, so I had to either leave it on all the time or shut it down, and it booted kind of slowly, so it was the environment or me waiting an extra five seconds, and I already told you how precious time is to me.

So this has been going on for four years or so, with lots of web searching and macosxhints.com this and osxfaq.com that and Apple support knowledge base and google searches, all looking for answers to my problem. No one seemed to have exactly the same set of problems, specifically that putting the computer into sleep mode would cause it to reboot. I kept searching, tried all the basic troubleshooting (PRAM this, reset PMU that), tried different plugs and cords, etc etc etc. Tried a buttload of things. Considering replacing the power unit, since that was obviously the problem. Oh, and sometimes the Power button on the tower would not so much want to work without lots of pressing.

This weekend, I tackled the problem again, since a mechanical problem MUST have a mechanical solution, right? Dr. Genius put on her labcoat. Hmm, I guess I'll have to replace the power unit after all...I wonder what that'll be like? It'll probably be like the last time, when Apple sent a replacement unit and fan because the fan was too loud, and I switched out the....

Oh. Hmmm. Maybe I should retrace the steps from that long-distant operation and, uh, reseat the stuff I seated anew at the time. And reseat the power button thing, too, while I'm at it. I mean, it's the old Check That Your Cables are Fully Plugged In, step Uno of any troubleshooting, but how silly would it be if that were the prob...

Hey, look! My computer now sleeps again, the USB cables on the monitor work like a charm, the old USB and firewire ports fire up like gangbusters...I'm a genius! And it reboots fast enough even for me (which, alas, gives me less time to wonder What's That Thing around the house, like the black tubes mysteriously poking out of our balcony walls).

How did the old G4 chug along for the last three or four years with this underpowered handicap? I don't know. All credit to Apple construction, I guess.

This is the support article that finally got me on the right track re: reseating plugs and jogged my memory.

And I finally solved the chronic "G4 won't remember the keyboard configuration of my Microsoft Natural Elite Keyboard, so I have to run Keyboard Prefs and Change Keyboard Type every damn time the thing reboots or comes back from sleep, which it now can do, sleep I mean, thanks to my geniusocity" problem by, um, trashing the keyboard plist. Huh. That solution only took me a year or a year and a half to find, but that time is misleading because my computer wouldn't sleep anyway, so it wasn't usually a problem. I finally noticed that the plist file wasn't modified when I changed the pref via System Preferences.

The "Mail.app Smart Folders count does not refresh" problem is ongoing and seems to come down to rebuilding the relevant mailboxes, but I don't care much about that and think it's more an Apple bug/oversight than anything I can fix.

The moral of the story is: I'm a genius. The other moral is: how am I going to put off writing if everything on my computer works now? The third moral is: when people give you the troubleshooting advice of "it's broken, buy a new one", curse at them with your worst, most insulting words and run away quick because they are almost always wrong and also lazy and perhaps also smelly.

10 July 2007

I had a great idea


It was so great, it startled me. And this is what happened to my hair.

And then I forgot the idea.

16 August 2006

Hairdo -- for those days when you just want bangs


So I put my hair in a ponytail on the top of my head, then pulled down the ends to make bangs, then took a picture. I think it looks HOT! Blonde ANDROGYNY, which goes great with my GIANT HANDS!

Look, it's August and it's slow and this is how I stay mentally sharp.