The discovery, acceptance & management of life's gaps

Sorting with AppleScript (AppleScrunix Style)

Friday 29 April 2011 - Filed under automation + gaps + Technology

As there is no built-in sort function in AppleScript you have to create your own. A common way of sorting lists is to use the repeat function… cycling through the list comparing items as you progress.  One of the more efficient approaches is a bubble sort. You can find an excellent example in Lesson 18, “Working with Lists and Records” in Sal Saghoian’s book, AppleScript 1-2-3.

This AppleScript bubble sort was taken in part from Sal’s book:

set fruit to {"pears", "bananas", "apples", "grapes", "watermelon", "pineapple"}

set last_swap_position to length of fruit

repeat while last_swap_position > 0

set comparisons_needed to last_swap_position - 1

set last_swap_position to 0

repeat with i from 1 to comparisons_needed

if item i of fruit > item (i + 1) of fruit then

set swap_item to item i of fruit

set item i of fruit to item (i + 1) of fruit

set item (i + 1) of fruit to swap_item

set last_swap_position to i

end if

end repeat

end repeat

return fruit

= {"apples", "bananas", "grapes", "pears", "pineapple", "watermelon"}

Using AppleScrunix you can sort the same list using a shell script sort command:

set fruit to {"pears", "bananas", "apples", "grapes", "watermelon", "pineapple"}

set text item delimiters to {ASCII character 10}

set fruit to fruit as string

set fruit to paragraphs of (do shell script "echo " & quoted form of (fruit) & " | sort -f")

set text item delimiters to ""

return fruit

= {"apples", "bananas", "grapes", "pears", "pineapple", "watermelon"}

Though it doesn’t save much coding, it executes faster, especially as the lists get longer. Using sort, via shell, also allows for files/lists to be sorted without having to open them. I will cover that in a future post.

We will continue to delve deeper into AppleScriptAppleScrunix in future posts.

4 comments  ::  Share or discuss  ::  2011-04-29  ::  Russ Leseberg

The Birth of AppleScrunix

Thursday 31 March 2011 - Filed under automation + gaps + Technology

On March 24, 2001 Apple introduced it’s ‘Unix’ based version of Mac OS, Mac OS X. Steve Jobs said, “Mac OS X is the most important software from Apple since the original Macintosh operating system in 1984 that revolutionized the entire industry.” See Mac OS X Hits Stores This Weekend. The following 10 years saw Apple morph from has-been to has-it-all. Check out Adam Rosen’s fun piece chronicling the evolution of OS X, Welcome to Mac OS X: An Illustrated Introduction [10th Anniversary], on Cult of Mac.

While reinventing the Mac, Mac OS X also revitalized my favorite scripting language, AppleScript. In addition to providing “control of scriptable applications and of many parts of the Mac OS,” OS X gave AppleScript access to the power of Unix, and introduced me to what I like to call AppleScrunix.

AppleScript has long offered Mac power users a way to do what they love to do better and faster. Sal Saghoian, AppleScript Product Manager at Apple, and de facto king of AppleScript, rightly states in his book, AppleScript 1-2-3, that AppleScript is the “power to make the computer do what you want and need it to do for you.”

The mashup of Applescript and Unix, AppleScrunix, brings two automation powerhouses together, creating (arguably) the most powerful automation platform on the planet. A simple example can be illustrated by solving a common problem in scripting, that of creating a date/time string for the unique naming of files.

In order to create a date/time string to append to a file name consisting of Year, Month, Day, Hours (military time), Minutes and Seconds, such as 20110331155523

…straight AppleScript might look like this:

set cd to (current date)

set text item delimiters to ""

set dateTime to year of cd & text items -2 thru -1 of ("0" & (month of cd as integer)) & text items -2 thru -1 of ("0" & (day of cd)) & text items -2 thru -1 of ("0" & (hours of cd)) & text items -2 thru -1 of ("0" & (minutes of cd)) & text items -2 thru -1 of ("0" & (seconds of cd)) as string

…with AppleScrunix you can do this:

set dateTime to do shell script "date +%Y%m%d%H%M%S"

We will delve deeper into AppleScrunix in future posts.

 ::  Share or discuss  ::  2011-03-31  ::  Russ Leseberg

The Stranger in the Zebra Suit

Sunday 27 February 2011 - Filed under Branding + gaps + thoughts

When I got up this morning I had no idea who Daniel Rothamel, aka: The Real Estate Zebra, was. Less than 8 hours later… I started following him on Twitter, @RealEstateZebra, asked to connect on LinkedIn and found myself blogging about him.

Why… you ask? Spend a couple of hours reading what his friends and colleagues have to say about Daniel Rothamel and you will want to be his friend too.

Checking my Facebook account this morning I came across a post by long time friend, Jeff Turner: Pay Attention To Your True Brand. You might remember Jeff from my July 2009 post, Living Your Brand. As expected, I enjoyed Jeff’s post and found his insight refreshing. What I didn’t expect, is that I would spend the next several hours learning about Daniel Rothamel of Strong Team Realtors, a lawsuit and the social media storm that has followed.

Zebra-artGoogle Search = ‘zebra lawsuit’ turned up these images (*credits below)

Just 5 days ago, on February 22, 2011, Denise Lones, President of The Lones Group, filed a complaint and ‘Demand for Jury Trial’ against Rothamel and Strong Team. Beyond what The Lones Group must have imagined… while the District Court of Washington was processing the paperwork… the court of public opinion granted a speedy trial and a jury of their peers assembled overnight. What probably appeared black and white then, [Yes, I too have fallen victim to zebra imagery], must seem much more gray and uncertain now.

The Lones Group took a wrong turn long before they filed the lawsuit. As Jeff Turner pointed out in his post, they shifted focus from theirtrue brand to the words and images that simply represent it.” Urs E. Gattiker, in his ComMetrics post, Brand vs. Reputation, cites Jeff Bezos, the founder of Amazon, “Your brand is what people say about you when you are not in the room,” and Richard Branson, founder of Virgin Airways, “Build brands not around products but around reputation.” At this point, I doubt The Lones Group has any misgivings about what is being said when they “are not in the room.”

Regardless of what ultimately happens with the lawsuit, Denise Lones and company has managed to do some good. They have helped strengthen Daniel Rothamel’s brand, grow his circle of friends and ignite a popular twitter meme… #SaveTheZebra. They’ve inspired his supporters to speak out thru Facebook, YouTube, and countless blog posts/comments. Their actions even lead to the creation of a fund for Daniel’s legal defense. And last but not least… without Denise Lones grossly underestimating how truly connected and small the world has become… I might not have met Daniel Rothamel, our friend in the Zebra Suit.

* Image Credits…
Left: Pic of Daniel from Chris Brogan’s post: Are Zebras Endangered
Right-top: Pic of Zebra from Mariana Wagner’s post: The Lones Group Files a Lawsuit Against Strong Team REALTORS® Over a Fricken’ Zebra Stripe?
Right-2nd-from-top: Pic of Sign from’s page: The Lones Group vs Daniel Rothamel – Posts, Twitter Updates & Links
Right-3rd-from-top: Pic of Zebra on Laptop from Ashley Drake Gephart’s post: The Lones Group: a “case” of online reputation
Right-bottom: Pic of Zebra Pattern from Benn Rosales’ post: Would the real Zebra, please stand up? Realtor, blogger, sued

Tagged: » »

2 comments  ::  Share or discuss  ::  2011-02-27  ::  Russ Leseberg

Added links for The Stranger in the Zebra Suit

Sunday 27 February 2011 - Filed under Branding + Communication + gaps + thoughts

Real Estate Zebra’ hit with trademark suit
Real estate agent and blogger Daniel Rothamel — known for years to his readers as the “Real Estate Zebra” — has been hit with a trademark infringement lawsuit by a company that produces a “Zebra Report” and “Zebra Blog” to market its services to real estate agents.

Would the real Zebra, please stand up? Realtor, blogger, sued
Daniel Rothamel, popular blogger, Realtor, and friend to many was sued on Febuary 22, 2011 in Seattle District Court demanding relief in regards to Rothamel’s use of the Zebra stripes “trade dress” violations. The suit alleges that Rothamel and the Strong Team Realtors have violated their trademark by using the zebra stripes and alleges use of their trademark “was and is calculated to cause injury to Plaintiff in the State of Washington” which is why they’re seeking $75,000 in damages.

Zebra trademark backlash
About a week ago, The Lones Group in Washington state brought an action for trademark/tradedress infringement against Dan Rothamel and Strong Team Realtors (in Virginia) over the defendants’ use of some allegedly “confusingly similar” elements. As often happens, this didn’t sit well with a number of people (check out Twitter hashtag #savethezebra). Does the Lones Group have a case? If not, what could they have done differently to protect their marks? Could this have been resolved without a formal complaint and the resulting backlash?

 ::  Share or discuss  ::  2011-02-27  ::  Russ Leseberg

ANSWER Communication(s) – Project Team Principles

Monday 21 February 2011 - Filed under Communication + gaps + GTD + project management + Teams

The acronym ANSWER serves as a guide to successful communication. ANSWER stands for Accurate, Necessary, Succinct, Written, Effective and Responsive.

Accurate – Accurate information is critical to the success of any endeavor. When providing information, verify the source and the data. It is better to have no data than bad data, as inaccuracy leads to waste and frustration. When forced to guess, estimate or provide other “less-than-precise” information, identify it as such.

Though often overlooked/avoided… effective project communication requires us to accurately document our activities and progress. The entire team benefits when each member lives the mantra, “Do what you say and say what you do.”

Necessary – I have often heard it said, “You cannot over-communicate.” Though I understand the statement’s intent, I must disagree. Anyone who has sat through countless unproductive meetings or digs out daily from under a pile of e-mail knows over-communication is possible. Though an often over-looked criteria, simply ensuring your communications are necessary saves time and frustration. If it doesn’t bring value, don’t say/send it.

Succinct – An economy of words doesn’t simply save time, it eliminates the necessity of sorting the needle of importance from a haystack of trivia. Keep all communication short and concise.

Written – If it is worth saying, it is worth writing. Documenting specifications, plans, procedures, etc., facilitates understanding today and provides confirmation tomorrow.

Effective – A message sent is only as useful as the message received. Creating an effective communiqué requires a full understanding of the objective and the audience. E-mail, reports, charts, or information in any form, are only effective when concepts are easily understood and can be quickly acted upon.

Effective communication is an investment in mutual success… paying repeated dividends to the recipients; the team and the project. When a picture is truly “worth a thousand words,” let it do the talking. Never underestimate the power of shared vision- go to the effort of creating a chart or diagram. Even when our utilitarian mainstay, e-mail, is the most fitting form of communication, take time to choose your words carefully.

Responsive – Good communicators are responsive communicators. A quick note letting the team know you got it is just as important as working on it. And when your task is complete… return and report.

How to leverage the ANSWER acronym...
When communicating with others, use the ANSWER acronym. Let it remind you that project communication…
A. (Accurate) … must be accurate.
N. (Necessary) … adds value only when it is necessary.
S. (Succinct) … should be succinct.
W. (Written) … is most useful when written.
E. (Effective) … is worth additional preparation to provide effective presentation.
R. (Responsive) … should be responsive in content, form and timeliness.

 ::  Share or discuss  ::  2011-02-21  ::  Russ Leseberg

DREAM Teams – Project Team Principles

Sunday 30 January 2011 - Filed under Communication + gaps + GTD + project management + Teams

When building project teams, remember that DREAM Teams are winning teams. DREAM stands for Decision Makers, Representation, Expertise, Ability and Manageability.

Decision Makers – Involving decision makers (management) on project teams is essential, but projects represent additional burden on already limited schedules. Most decision makers understand the need for their participation and will embrace decision-point activities when demands on their time are respected, planned for and efficiently coordinated with their other duties. In cases where management appoints a “decision delegate” [entrusting limited decision-making authority], it is imperative that all guidelines/parameters surrounding the extension of trust be followed implicitly. A project is not a license to assume/abuse authority. Any extended decision-making authority must be officially/openly expressed and outlined in the project documentation.

Representation – Appropriate stakeholder representation is key to the success of any project. Project stakeholders include anyone affected, anyone responsible for people and/or areas affected, management and those charged with the completion of the project. Stakeholder representatives act as agents of all stakeholders and have a duty to ensure that the needs of the many are reflected in the activities of the few.

Expertise – The inclusion of appropriate SMEs (subject matter experts) assures that the right knowledge, skills and expertise are brought to bear on project objectives/solutions.

Ability – Project teams need members with the ability to carry out their individual tasks. A person’s ability is not only demonstrated by his or her talents and skills, but also his/ her “avail-ability.” For teams to perform successfully they need the opportunity and the “cap-ability”.

Manageability – Project management is not possible if the team is not manageable. Limiting the size of project teams increases manageability and allows for more projects to proceed. Furthermore, managing how often, how long and how many team members are involved in each activity buys back valuable time, allowing more work to proceed simultaneously.

How to leverage the DREAM acronym…
When assembling teams, ensure they have all the needed ingredients. A successful project DREAM Team…
D. (Decision Makers) ... includes the involvement of the appropriate decision makers or their delegates.
R. (Representation) … has appropriate stakeholder representation.
E. (Expertise) …has the needed expertise.
A. (Ability) … consists of those with the ability to devote themselves to the team and the project.
M. (Manageability) … is manageable when it is the right size with the right people in the right places.

1 comment  ::  Share or discuss  ::  2011-01-30  ::  Russ Leseberg

Add FLAVOR – Project Team Principles

Friday 31 December 2010 - Filed under Communication + gaps + GTD + project management + Teams

It is the personal responsibility of every project team member to add FLAVOR. FLAVOR stands for Follow, Lead, Attitude, Value, Ownership and Respect.

Follow – A critical skill for all team members to master is that of following someone else’s lead. In project driven organizations, leadership roles can change from one meeting to the next. When someone else is leading, fully support him or her. Great leaders are first great followers.

Lead – Everyone ends up in a leadership role at one time or another. When it is your turn, don’t be afraid to lead. When given the lead, treat your role and all team members with respect. When leading, you have the dual obligation of managing activities and resources efficiently while managing relationships respectfully.

Attitude – The most important contribution anyone makes to the team is his or her attitude. You ultimately have to hold yourself accountable for a positive, cooperative, and success focused attitude. Before managing anything or anyone else, you must first be willing and able to manage your attitude.

Value – Always add value. Bring it to your meetings, your projects, your solutions and ultimately your customers. In any given situation, be willing to ask, and ready to answer the question, “What value does my participation add?” Recognize and celebrate the value in others. Learn to measure and assess value within the context of the objective(s).

Ownership – Take personal ownership for all you do. When given a task, stay with it. When ownership passes to someone else, don’t drop it, hand it off. Own your words, your actions, your attitude and your assignments.

Respect – Everyone has the right to be respected, and the obligation to respect others. To be successful, those you serve and those you serve with need to be assured of your respect. Show it in your meetings, e-mails, after-hours discussions, etc. Respect each other’s ideas, time, abilities and responsibilities.

How to leverage the FLAVOR acronym…
You begin to realize your full potential and what your contribution means to a team, when you recognize the power of individual choice. Choose to make a positive difference and let the FLAVOR acronym serve as a personal reminder…
F. (Follow) … for you to follow when appropriate.
L. (Lead) … for you to lead when appropriate.
A. (Attitude) … that you and you alone are responsible for your attitude.
V. (Value) … of the constant obligation of finding ways to bring value to the team and to the project.
O. (Ownership) … to take personal ownership of assigned duties, deadlines and deliverables.
R. (Respect) … to treat everyone with respect and ensure it is evident in all you say and do.

4 comments  ::  Share or discuss  ::  2010-12-31  ::  Russ Leseberg

MobileMe & the iDisk Gap (Bridging the gap)

Tuesday 30 November 2010 - Filed under gaps + mobile + Technology

I am a fan of most Apple products and usually do not hesitate recommending them. MobileMe has been a glaring exception. While I consider the overall value of MobileMe to be well worth the $99 per year, the iDisk service has been slow and buggy. Despite an extended marathon on the Apple Tech Support Line and a myriad of in-store genius attempts, the performance has remained ‘iffy’ at best.

Enter Transmit 4 software by Panic Inc. Add Transmit 4 to iDisk and you more than solve the problem, you blow it away. Combining Transmit 4 and iDisk gives you a glimpse into the flexibility and power of cloud-based storage. So Steve, ehh… Mr. Jobs, how about buying Panic Inc. and making iDisk the cloud storage solution it was born to be. Cloud-based computing is only as good as the bridge you take to get there.

1 comment  ::  Share or discuss  ::  2010-11-30  ::  Russ Leseberg

It Was the Least I Could Do (Funny things we say)

Sunday 31 October 2010 - Filed under Communication + gaps + thoughts

Many of the funniest gaps surface in our conversations. There is often a gap between what we mean to communicate and what we actually say. Though some phrases may not seem funny on the surface, when interpreted literally they can be quite humorous. Two of my personal favorites are “It was the least I could do,” and “I’m sorry to hear that.

When thanked for a kind deed or gift we often respond “it was the least I could do.” Did we actually calculate the least possible generous outcome before acting? Or… when someone shares bad news with us, do we really mean “I’m sorry to hear that?” It is more likely we’re sorry it happened rather than… sorry we heard about it.

When sharing these musings with my father-in-law, he offered his favorite funny-things-we-say in return. He doesn’t like hearing “hurting you is the last thing I would want to do,” because he figures it is still on their to-do list.

What are some of your favorite funny-things-we-say? Please share.

Tagged: »

1 comment  ::  Share or discuss  ::  2010-10-31  ::  Russ Leseberg

My iPad and I take to the Skies

Thursday 30 September 2010 - Filed under gaps + mobile + Technology

I fly a lot and it seems as if the space between plane seats narrows a bit more every year. So much so, I gave up using a laptop to get any work done on most flights. When I got my iPad I gained back much of the work time I had lost, but it meant giving up one of my favorite seats, 8A, at least on a CRJ (Canadair Regional Jet).

CRJ 8A - iPad Unfriendly Seating for Right-handers

CRJ 8A - iPad Unfriendly Seating for Right-handers

Row 8 window seats on the CRJ are great because they remove the arm rest toward the exit door giving you an extra 2 inches of width. Width a man of my… ehm… build thoroughly appreciates. Since I hold my iPad with my left hand and navigate with my right, however, 8B is less than thrilled.

Who would have guessed we would be changing airplane seats to accommodate gadgets? Note to self, let travel agent know… 8D is the new 8A.

Tagged: » » » » » »

 ::  Share or discuss  ::  2010-09-30  ::  Russ Leseberg