CartMetrix - Do you know yours?

6/25/2007

Grep Replace and Word Processing

I spend so much time in a text editor, its hard to get my head around a word processor sometimes. Text and formatting at the same time?

Moving some content around I found myself with a ton of links formatted in an unordered list. I only needed the plaintext of the name and link separate for the current project. My trusty BBEdit with Grep search and replace support yield the following search and replacement patterns to make quick work of the list.

Search Grep Pattern

<li><a href=“(.*)”>(.*)<\/a> ?<strong> ?\((.*)\)<\/strong><\/li>

Replace Grep Pattern

\2\t\(\3\)\r\1\r

Turned this

<li><a href=“http://www.agentb.com/”>AgentB</a> <strong> (Deals)</strong></li>

into this

AgentB (Deals)
http://www.agentb.com/

I always keep an empty BBedit window for text processing like this. Its easy to paste a chunk of text, process it and then paste it back into your word processor.

Note:
I’m almost good enough at Grep search patterns to make this viable in all situations. It used to take me 5 minutes to debug and expression that would have taken 2 minutes to cut and paste manually. I had this one whipped out in much less time than it would have taken to manually cut and paste a hundred of these.

Popularity: 22%

3/28/2007

Todo.txt - A Command Line Task Tracker

I found Todo.txt by Gina Trapani, randomly last weekend and have been playing with it all week. Todo.txt is a todo list written in shell script. It should run fine under any system that supports a Unix like shell… Linux, OS X, Cygwin etc.

At any given time I have a half dozen post-it pads going with todo lists, usually the things that have to get done TODAY! Todo.txt is so simple to use I’ve misplaced most of my post-it pads (still need paper for the grocery list). :-)

Some examples:

todo.sh add This is my first task
todo.sh add Another task
todo.sh list
02 Another task
01 This is my first task

TODO: 2 tasks in /Users/damonp/etc/todo.txt.

Set task number one to the highest priority, A.

todo.sh pri 1 A
todo.sh list
01 (A) This is my first task
02 Another task

TODO: 2 tasks in /Users/damonp/etc/todo.txt.

I haven’t gotten much further than adding, prioritizing and marking off items, but the builtin help shows options for archiving, reporting, appending, prepending and deleting items.

Popularity: 16%

3/25/2007

Advanced OSX Mail Searches

When you live and breathe email for work and play, it can be quite important to keep messages around for reference. In my business, client and project specific correspondence is supremely important as a record of what has been done, what needs done and project cost quotes among other things. The important information usually gets copied into my bug tracker, project information database and billing applications, but there is just something about the chronological nature of email that helps me follow a project.

What’s the point of keeping email around if you can’t accurately find the messages you are looking for? Apple’s Mail application can be used to do some heavy lifting searches if you can think outside of the box a little. Below are some examples of the general boolean search available directly in Mail.

Heads AND Tails

heads & tails

Heads OR Tails

heads | tails

Heads but NOT Tails

heads ! tails

Heads AND either Tails OR Both

heads & (tails | both)

While researching these search options I found some users that reported that and, or and not worked as well. This is not listed in the Mail documentation and I was not able to confirm their usage. These did not work on my machine. For reference, I am running 10.4.9 and Mail 2.1 (752/752.2).

From the Mail help system:

If you search the From, To, or Subject fields in selected mailboxes, Mail finds messages that contain the entire search phrase, in the order you entered the words. If you search an entire message or search in all mailboxes, Mail finds only messages containing words that have the same prefix (or the same beginning letters) as any of the words you entered in the Search field. The words can be in any order. For example, if you enter “box” in the Search field, the results would include “boxcar” but would not include “mailbox,” because “box” is not part of the prefix in that word.

The help document also mentions that any IMAP accounts need to be configured to “Keep copies of messages for offline viewing”. This setting is configured from the Advanced tab of the Accounts pane in Mail Preferences. The default is to cache “All messages and their attachments.” I use “All messages but omit their attachments.” I would like to use “Only messages I’ve read,” as that would omit all of the uncaught spam and messages that get deleted without being read, but from my tests that option still caches the attachments. I think caching attachments is a waste of bandwidth and local disk space, plus it doesn’t fit in with my normal usage. When I get an important attachment, I download it to a local folder, either a client folder to keep with the rest of the client data or to my general downloads folder where it can be dealt with and deleted when no longer needed.

I have been using a beta version of MailTags for a month now and am finding it more and more invaluable in tracking project and client emails. It adds customizable fields to messages so may easily tag a message with a project name or add notes to a message and adds to the built-in Mail search so you can search by these tags specifically. It also integrates nicely with OSX’s Calendar application, allowing you to create To Do items directly from the MailTags pane in a message.

Another searching option is to create a Smart Mailbox with your search parameters. Smart Mailboxes can be used to mix and match multiple search parameters in the same search. Don’t be shy about creating a Smart Mailbox to do a one-off search. Wouldn’t it be faster to create a Smart Mailbox, use it to find your messages and delete it afterwards than to manually search for a message for twenty minutes? You can also create a Smart Mailbox to pre-select a group of messages, say by including all messages from all of the parties involved in a particular project and then using Mail’s basic search over that Smart Mailbox to find only those messages that contain a particular keyword.

There are some shortcomings I find in Mail’s search and Smart Mailbox implementations. My biggest beef is that Mail won’t let you Cmd-select multiple locations to do a keyword search over. For instance, you cannot search for an email address that appears in the From or To fields. You can do separate searches for both and manually merge them in your head or setup a Smart Mailbox to do the task.

The Smart Mailbox implementation is also crippled in that you can only select messages by all the criterion you supply or by any single criteria not some of these but none of those. This can be overcome by using multiple Smart Mailboxes, one to select all of the messages you want and a second mailbox to deselect the ones you don’t need that happen to fall in to the first mailbox.

Say you would like all messages from a particular domain except the general address info@domain.com. First create the deselect mailbox that finds all messages from info@domain.com, then create a second Smart Mailbox that selects all messages from domain.com and add a second criteria to it that says “Mail is not in mailbox” and choose the deselect Smart Mailbox you created. This is a simplistic example that can be overcome by creating a box that manually selects all messages from user1@domain.com … userN@domain.com, but that would require you to know all of the addresses and key them in.

All in all Mail’s searching implementation is powerful if you know the right tricks. Have some more Mail search tricks? Post via the comments below.

Popularity: 31%

12/15/2006

Hack to Open Popup Pages in Main Window

I hate popups and links that open in a new window. I can control where I want windows to open. If I want a new window or tab, I’ll use the appropriate key combinations when clicking the link.

If a window opens in a popup without a menu bar or url bar, hit Apple + T to force a new tab in the popup window. Then you can click and hold on the first tab and drag it to the tab bar of a full window to get the page to open in a window with a menu and url bar.

Popularity: 27%

4/18/2006

Use Google As Caller ID

Receive a call from a number you don’t recognize? Google it and see what pops up. If its a call from a business, they’re likely to have their telephone number listed on a website somewhere.

I have found these forms work the best:
###-###-####
###-####

You can always Google the three digit area code to find out where the call is coming from.

Popularity: 17%

9/19/2005

Use a Read Folder to Keep Track of ToRead Items

Stop keeping windows open as a todo reminder

I typically keep a half dozen browser windows open, each with as many tabs. I use them as reminders; things to do, blog posts or articles that I want to read by haven’t had time, current projects, stats of sites I’m monitoring etc. With CodeTek VirtualDesktop it’s easy to get things all spread out.

Lately I’ve noticed my PowerBook (1.5GHz, 1.5GB DDR RAM), bogging down. There’s no reason I should be able to type faster than a new machine with that much RAM can think. Off to track down the resource hogs…

Firefox and Safari are maintaining a 10% - 12% draw on the CPU, each! I cycle through the tabs of each looking for a site stalled or any reason for the suckage. Nothing. There are quite a few blog posts and news stories that are running highly animated ads. Not to start a rant, but these ads are using my resources to try to sell me and impacting output by wasting CPU cycles that I should be using instead. There has to be a better way…

To start, I created a folder Reads on the desktop. Whenever I find a page I need to investigate further, whether its too long to read in the current flow of work or can’t be dealt with immediately (and doesn’t deserve a bookmark yet), I drag a link to it to my Reads folder and close the broswer tab. Done. Back to work.

I find the folder more useful than bookmarks for many reasons. Its easier. Easier to drag and drop and easier to view at a glance. Its sortable. The links can be renamed to something that makes sense to me or so like items alpha sort together. Real documents, PDFs, Word, emails and text can be stored along with the links. Subfolders can be created to further categorize items by status, project or personal/work.

The folder is sorted by date, newest to oldest so the most recent items are at the top. This serves multiple purposes. Items dealing with in progress projects are more likely to be at the top and easily accessible. If an item has been around for several weeks and hasn’t been dealt with, it’s easy to see what needs purged.

This surely is better than wasting CPU cycles keeping a window around for two weeks as a reminder to do something that’s never going to get done anyway.

Popularity: 17%

Next Page »


damonparker.org is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

copyright © 2002-2008 damonparker.org. all rights reserved.

Close
E-mail It