AppleScript for Creating Form Documents in Word 2008

properller.jpg

Okay gang, put on your propeller beanie caps. This one is going to be complicated.
One of the things I do during the day job includes a lot of corporate transactional work. As a result I have a few forms that I find myself using repeatedly. For instance, sometimes I have a client that needs a set of corporate minutes. I would like to have a system where I can run a program that prompts me for certain bits of information (i.e. date, corporate officers and directors) and then goes off and opens the form and fills in the basic information for me.
You think there would be guides all over the InterWeb for this but I couldn’t find any. So I spent a few hours today learning to Applescript and came up with the script I’m reporting below. I’m no expert at this and I’m pretty sure this could get better but at least my script is functional and hopefully saves the next person from the trouble of starting from scratch.
So I’m going to list the whole script below and then I’m going to break it into pieces. So lets start with the whole script …

scripteditor.gif

— Dialog Box to Get Information
set response to display dialog “Type in the name you want to paste” default answer “Thelonious Monk”
set name to text returned of response
tell application “Microsoft Word”
open “Macintosh HD:Users:david:Library:Application Support:Microsoft:Office:User
Templates:My Templates:Piano Legends.dot”
— Name
set selFind to find object of selection
tell selFind
set content to “**Name**”
set content of replacement of selFind to name
execute find replace replace all
end tell
end tell

So breaking it down let me explain as best as my tiny programming brain can. If you are a complete Applescript newbie you need to first open Script Editor which can be found in the Applescript subdirectory of you Applications folder and then copy the above script in.
— Dialog Box to Get Information
The two dashes make this line a remark so the program basically ignores it. This sample has only one variable but the actual script has twelve variables. I named each with a remark so I can get back to where I need easily to debug if necessary.
set response1 to display dialog “Type in the name you want to paste” default answer “Thelonious Monk”
This line does two things:
First it pops up a dialog box that says “Type in the name you want to paste”
Second it fills in the box with a default answer of “Thelonious Monk” (Has anyone figured out yet what a big Monk fan I am?)
set name to text returned of response
This was the line that vexxed me the most. Simply putting up the dialog box does not create a variable that can be used to fill in a Word form. This line of code creates a new variable called “name” and fixes the problem. It took me an hour to figure this out.
tell application “Microsoft Word”
Now we are getting to the good stuff. Applescript just opened Word 2008.
open “Macintosh HD:Users:david:Library:Application Support:Microsoft:Office:User Templates:My Templates:Piano Legends.dot”
If you are going to be creating forms you first need to create a template in word. In this example I’ve created a template (.dot extension) in word called “Piano Legends.dot”. Obviously the location of your document template may vary slightly. When you create the template it is important that you distinguish the phrases you plan on replacing. I did it with asterisks. For instance the name section of the document is written “**Name**”. In setting it up this way you don’t need to bother Applescripting the formatting because the script just uses whatever formatting you chose in the template (i.e. All Caps, bold, etc…)
— Name
Another comment telling me I’m about to do the find and replace on the Name variable.
set selFind to find object of selection
I’m a bit clueless on this line but the script fails if it is not there. I think it selects the entire document for the find/replace action.
tell selFind
set content to “**Name**”

This starts up the find and replace process. It also sets the variable “content” to the search text I placed in the template as explained above, “**Name**”
set content of replacement of selFind to name
I just told Word “Find every instance of “**Name**” and replace it with the variable “Name”
execute find replace replace all
Word knows what I want it to do. Now it has to go do it.
end tell
Closing the loop.
end tell
Closing the loop again.
So there you have it. A rather tame Applescript that helps automate document production. You can duplicate as many variables and replacements as you need. I’m surprised about how easy this was to figure out considering I’m not much of a code jockey but it sure is handy.

Continue reading

Positive Review for Powerpoint 2008

officemacex2.jpg

Brian Peat over at KeynoteUser.com wrote up a long and positive list of initial impressions after using PowerPoint 2008. I must admit I haven’t even loaded it yet. I was a PowerPoint wizard before switching to the Mac. I was giving presentations at the courthouse before most people knew what PowerPoint was. I’ve done some great PowerPoint presentations over the years explaining really complex construction issues to jurors. Unfortunately, PowerPoint has now become a verb for boring people with ugly long bullet points. “He PowerPointed me to death.” But I digress.
The new look and feel you can pull off with Keynote was one of the reasons I switched to the Mac. Regardless, I still do contract work for other lawyers where I build PowerPoint and Keynote presentations for them so I’m glad to see Microsoft stepped up its game. Brian’s post has me interested and I’ll have to dig in with it soon. Here is to hoping PowerPoint and Keynote start a running battle with better presentation tools and easier coding for years to come.

Continue reading

Review – BusySync

busysync.jpg

Calendar syncing is a subject that can strike fear into the hearts of anyone who uses it. If your calendar data is important enough that you must sync it, you also probably can’t afford to lose it. Unfortunately the very process of syncing calendars on computers often has that very effect. With my Treo it was really bad. Somedays I’d sync and lose all my appointments. Other times I would end up with four copies of every appointment. It got to the point where I would just plug in and pray.
Nevertheless, I desperately need a calendar syncing solution in my home. The Sparks home is a hectic place under the best of circumstances. Because we are all so busy, it is embarrassing how often we double book ourselves and end up having to cancel plans.
It was with this problem in mind that I found myself at the BusyMac booth at Macworld looking at BusySync. The developers told me this application could reliably sync calendars with all of the Macs in my home without these headaches and without an OS X server. This is something I had to see.
BusySync allows you to share calendars. You can pick and choose which calendars to share and what kind of access you are giving the other users. You can give read only or write access. You can require a password, or not. BusySync then goes out over Bonjour or the internet and Syncs with other iCal users. Over Bonjour the syncing is really fast. Within seconds. I’ve been using it for two week now and am happy to report it just works.
In addition to giving you the ability to customize your sharing, BusySync also give you the ability to restore from a backup. Indeed BusySync keeps ten backups of your calendar at all times so if things do get all kerfluffled, you can restore with one click. Thank You BusyMac.
BusySync is the brain child of John Chaffee and Dave Riggle. These guys have long Mac calendar roots and were the original developers of Now Up-to-Date for the Mac back in 1991.
Getting back to the Sparks house, we now can all see each other’s calendars and we have a new calendar called “Family” so when we are planning that trip to the mountains we can all see it. If my wife wants to “schedule” me to watch the kids while she goes crafting with her friends she can first check to see if I’m stuck in court. Suddenly we aren’t double booking on top of each other and peace has broken out. Well sort of.
It gets better though, BusyMac is about to release version 2 of BusySync that allows you to also sync your iCal data with Google calendars. So with this one product you will get networked calendar syncing and Google sync allowing you to view and modify your calendars from any Mac or (dare I say it?) PC.
A BusySync license will cost you $20 per computer. When version 2 is released, the price will go up to $25 per computer but the upgrade will be free to licensed version 1.5 users. Not only that, BusyMac has agreed to give an additional discount to readers and listeners. For a limited time, you can get a 20% discount on BusySync by entering the coupon code “MACSPARKY”. Just go to www.busymac.com/buy and enter the coupon code.

Continue reading

Microsoft Word 2008 – Initial Impressions

Office 2008.jpg

So I’ve been complaining about Microsoft Word 2004 for some time now. It is sort of a love tolerate/hate relationship that goes back years. I know some people love it but I’m more of a Scrivener and Pages kinda guy myself. This doesn’t change the fact that my law office runs on Microsoft Word and we have some fairly complex document formatting. Pages is great for general Word compatability but is not up to scratch for some of the more complex stuff I seem to bang into.
Using Scrivener and exporting text files for my office staff has generally worked out pretty good. A few months ago I had decided I probably wouldn’t bother with Office 2008. A few things changed that. First, on black Friday, Microsoft had a great deal that gave a $100 rebate on any copy of Office 2004 purchased that day along with a free upgrade to 2008. So I got in for a very reasonable price. Second, I was at David Pogue’s session at Macworld when he interviewed the chief Office 2008 Microsoft honcho. Imagine a room of about 1,000 Mac geeks and in walks a Microsoft executive. Talk about a hostile environment! The guy (I’ve been trying to find his name but can’t so I’ll just call him “the guy”) was actually very friendly and passionate about the Office 2008. I had to hand it to him for just showing up.
Anyway, I’ve now been using Word 2008 for three days and these initial impressions are just that … initial impressions.

1. Word 2008 Runs Faster.

Word 2004 was dog slow on my Intel Mac. It was slow to load and (if this makes any sense) text input. There was a delay between my typing the letter and it appearing.

2. Word 2008 is More Mac Friendly.

I don’t know how to put this but it feels more like a Mac application than Word 2004. The inspectors are cleaner and the general look is much improved.

3. Word 2008 is very Compatible with PC Word.

This has always been true but thankfully all of the complex formatting still works. It seems to be even better on some accounts which (I believe) is related to fonts but it is too early to say.
I’ll keep you posted as I dig a bit deeper.
———–Post Update ——-
“The Guy”, Craig Eisler, was kind enough to write in on the comments. Craig, along with the improved Word 2008, is really doing a good job of smashing up a lot of my bias against Microsoft.

Continue reading

Smarter Right Click in OS X

MacBook_touchpad.jpg

I found myself in the mouse system preference pane tonight and noticed a little checkbox …

Trackpad options.jpg

“For secondary clicks, place two fingers on the trackpad then click the button”
Hmmm.
I checked it and then put two fingers on the trackpad while clicking a desktop icon. It gave me the drop down menu consistent with a right click!
How come I never noticed this before. Now I can right click with one hand. Am I the only one that didn’t know about this?

Continue reading

Menubar Apps – Caffeine

Caffeine.png

Continuing my sort-of-regular posts about my favorite menubar applications, I direct you attention to the hot steaming cup of java in my menubar ….

caffeine 2.png

Caffeine!
Caffeine has the same effect on your Mac that it has on your body. It keeps things awake. This small freeware application has a tiny memory footprint and sits by idly until you activate it with a click. It then keeps everything awake. I find this most helpful when I’m watching video or sharing my screen with someone. Just today I was sharing a timeline on my screen with a client (you all remember how much I like timelines, right?). Anyway, I clicked on caffeine and had no pesky dark screens while I did my thing. Best of all, it is a lot cheaper than Starbucks. Indeed, it is freeware. Try it out yourself.

Continue reading

Happy Birthday to My MacBook Pro

MacBook_Pro.jpg

Today my MacBook Pro turned one. Happy Birthday Mac! The MacBook Pro was the perfect choice for me with a combination of power and portability. Sure I may like the power of a Mac Pro (did anyone see Don McAllister’s numbers on his eight core machine?) or the portability of a MacBook Air, but for my needs, this machine has been perfect. For a present, I think I will upgrade its hard drive.

Continue reading

OS X Backup Strategies

harddrive.jpg

I’ve had several people ask me about backup strategies lately so I thought I’d share a post about my ideas on the subject. A backup plan doesn’t need to be complicated. With some of the new tools available it doesn’t even have to be expensive. It just needs to follow a few simple rules.

1. Keep it Simple.

The more complex you make your backup plan, the less likely you are to follow it. Complexity used to be a requisite of a backup strategy. Thankfully that is not true any more.

2. One Backup is Quaint, Two Backups are Secure.

If you have your data backed up in one place you are “probably” okay. However there are a variety of circumstances that may cause one backup to be one too few. For instance, what if:
* You have a power surge that blows out your computer and your backup drive;
* A thief steals your computer and the shiny Western Digital box sitting next to it;
* Your computer fails and unbeknownst to you, your backup drive has been broken for several months?
That last one happened to a friend of mine. He lost five years worth of family photos. So having two backups in two different places is probably a good idea. If you don’t have a choice and only have one backup drive, I recommend you don’t keep it plugged in and store it somewhere else in your home.

My Backup Plan

My backup plan uses three external hard drives. I could pull it off with two but I happen to have an extra drive and I am a bit irrational when it comes to backups. So, anyway, my backup gear is …
1. a 1TB Western Digital MyBook with Firewire 800;
2. a 500GB Western Digital USB 2.0 Drive;
3. a 320GB Lacie USB 2.0 Drive.
My plan involves a combination of Carbon Copy Cloner and Time Machine. I was a happy user of SuperDuper but I’m still waiting for them to release a Leopard version. So my strategy is to keep it simple and keep in two places so what I do is this:

At Home …

I keep the 1TB and 320GB home on my desk. The 1TB drive holds my Time Machine drive and other miscellaneous stuff that doesn’t get copied in Time Machine like my Parallels folder, Aperture library, and a few other oversized files. The 320GB is used for my clone image whether it be Carbon Copy Cloner or (hopefully soon) SuperDuper. I do the clone a few times a week. Now I know 320GB is a lot for a clone drive. But if everything goes according to plan … I just may need that space soon. More to come on that later.

At Work …

The 500GB drive stays at my office and also holds a clone of my drive plus other miscellaneous media. The clone gets run a few times a week. Often I’ll set it to copy before heading off to lunch or a long meeting.
That is it. Simple system + multiple locations = Backup mojo.
So that is the heavy lifting of my backup plan. There are a few extra wrinkles however. For instance, I use my iDisk to keep copies of my essential documents. I know keeping it synced requires a nice chunk of hard drive space but I’m okay with that. I also store some files in the cloud in other places (Mozy is a good solution), and often carry copies of my most recent stuff on a 2GB thumb stick. I don’t do any backups to CD or DVD. It reminds me too much of the bad old days and boxes of floppies.
Let me know your plan or share it in the comments.

Continue reading

BusySync Review Gets a Raincheck

I seem to have come down with a rather nasty flu. I was all set to make BusySync this week’s feature review but, alas, my voice currently sounds more like a cement truck than a human. Rest assured the feature review will be back next weekend and publish with the MacReviewCast. In the meantime here is a hint.
I really like BusySync.

Continue reading