Sunday, July 31, 2011

Quantifying the Return on Investment Potential of Applescript


Many of the arguments for the adoption of workflow automation in general and AppleScript automation in particular might seem obvious. However, it is always nice to be objective and simply present established facts to support such claims, especially when you are attempting to convince those who control a budget that it is worth the investment.
As fortune would have it, in 1999 GISTICS, a research firm that investigates new technology adoption and the strategic role that third-party developers play in maximizing the payback of new technologies, created seven informative publications analyzing Apple's technology. One of them was titled "AppleScript Payback Assessment — Return-on-investment Calculations for the Deployment of AppleScript by Smart Media Producers". Although it is now more than ten years old, this 54-page document highlights some very impressive results from using AppleScript to automate a workflow. I have derived most of the factual data I present here from that report.


Monetary Savings

Deploying AppleScript solutions can yield return on investment (ROI) figures anywhere from a typical five-fold annual ROI to an astonishing 24 times ROI realized in the first year of AppleScript deployment. In 1998, AppleScript produced an estimated $100,630,500 in total savings for North American media producer firms. One firm, after an investment of 500 hours developing a suite of scripts, derived $500,000 to $1.2 million in annual savings.

Improved Quality

When deploying AppleScript as a strategic platform by which to reengineer and systematize business processes for profit, executives and owners derive higher quality production at significantly lower costs and shorter production cycles. Scripts don't forget even the smallest rules they are "taught" and the attention to detail never fluctuates, no matter how tedious the task.

Increased Productivity

Simple tasks can be performed three to ten times faster by using AppleScript. For example, AppleScript can reduce complex tasks such as the composition of a catalog from a nine-person workweek to less than one hour.

Increased Workload and Profit

AppleScript creates more predictable workflows, enabling firms to accept larger jobs and faster cycle times.

Rapid Implementation

Compared to the time required to plan and develop solutions built with programming languages such as C++ or Visual Basic, AppleScript solutions can be built very quickly. Time-saving ideas can become part of your daily production process in a much shorter time frame and require less development and troubleshooting than other languages can offer.

Wednesday, July 27, 2011

Understanding the Scalability of Applescript

AppleScript is highly scalable in size and scope. Scripts can start out small, automating a single task with a few lines of code. Over time, they can grow into multifunctional tools and awesomely complex applications. They can also be designed to adapt as business rules and requirements change. Understanding some of the different form factors a script can take is beneficial knowledge to have.

Transition Scripts

transition script is a small script that provides a simple way to transition from one context to another. These scripts might only save a few seconds each time they are used, but over time those seconds add up.
An example of a transition script is a small script that enables users to quickly open a server folder of their choice. A button on a contact record in FileMaker Pro that uses a small script to locate and open a related folder is another. A text "cleaning" script might manipulate text in the clipboard in a variety of different ways, such as removing or adding hard returns, sorting the paragraphs, adding or removing prefixes or suffixes, or quickly saving the data into a text file in a folder the user chooses.
If a user forwards or replies to e-mail with standard responses or instructions, a simple script can automatically prepare the e-mail for review. Or if a selected file needs to be sent to a group of people, it can be dropped on a script that gives the user a choice of e-mail, FTP (File Transfer Protocol), or some other method of delivery and of a list of recipients.
Tip 
People often underestimate how much time is lost navigating around a server or typing out commonly used instructions into e-mail messages again and again. Small transition scripts can make a huge impact on a workflow, especially when they are used by a large number of people.

Script Tools

script tool is a script that performs some specific function or set of functions. While the size and scope of the automated task can vary dramatically and can evolve over time, a script tool is narrowly focused, much like the tools you use in your everyday life in the garage or kitchen. They are meant to be executed on users’ machines while they wait, setting them apart from fully autonomous solutions intended to run on a servers or dedicated computers.
Note 
Script tools are probably the most popular type of scripts built with AppleScript. They are relatively easy to design and develop and they have an immediate positive effect on the user's work. Simple tools can cross the line into transition scripts while more complex ones might blur the distinction between tools and full-blown solutions.
One of the best examples of a script tool is a batch processor script. Batch processor scripts perform a limited set of functions on any number of files. They might add layers, flatten or resize images, modify file names, generate reports, look for errors, convert file types, merge or parse PDF pages, and many more similar functions.
Script tools can do just about anything. Some might create a complex folder structure for a new project or help copy standard files into a new user directory. Others may help a user create a new product sheet from one of a group of available templates. Script tools can help search documents for text overflow errors or help users connect to servers in the morning. There really is no limit to the kinds of tools a thoughtful developer can dream up.

Script Solutions

script solution is made up of one or more scripts that automate highly complex and often lengthy processes. While the size and scope of solutions can vary like script tools, a script solution is more broadly focused on a larger sequence or quantity of tasks. While a script tool might help a user create a paragraph for a catalog page, or tabulate some data, a script solution can assemble an entire catalog file from start to finish. Besides the size of the scripts, the major distinction between a tool and a solution is that the latter is intended to run with minimal to no human intervention.
A script solution might start out small and gradually expand. In fact, many times a group of script tools can merge and evolve into a solution. As they become more complex and begin to control more steps of a workflow, script solutions can expand into a multi-module solution made up of dozens or hundreds of individual script files that are managed by a primary module that orchestrates a complex workflow.
The most common type of script solution is desktop publishing automation. For example, a script can perform multiple find, sort, and export routines to gather product information from a database that will be placed and styled in a page layout document. Next, the script can find image files on a server and import, size, and position them. Throughout this process, countless business and style rules are consistently applied. Product subcategories are automatically started on a new page or in a new document. Spacing is dynamically adjusted based on the amount of content for each product. Once the file has finished building, the script can save it for review or print it to a PDF file. It might also cross-reference products and price lists, and scan the document for text overflows or other issues and report them in a dialog box, text log, e-mail, or any other communication software. The same process can apply to any type of file, including brochures, flyers, reference guides, catalogs, and more.
Script solutions can take many other forms. Some might watch folders for files to process or instructions to carry out. Others might monitor file servers and report misplaced files to administrative personnel and performance issues to technical personnel. Others may merge photos into a time-lapse movie or contact sheet. Solutions can alert, analyze, build, create, compile, convert, delete, export, import, modify, or report just about anything.

Sunday, July 24, 2011

Defining Workflow Automation


Workflow automation is the creation of a technological solution to automatically perform some or all of the tasks within a given workflow. Although the focus here is on automating manual activity performed with software on a computer, the term applies to anything that increases the efficiency of the user. This includes everything from an electric pencil sharpener to programmable welding robots building car frames, or even to the computers used to control the International Space Station.
The personal computer itself is an example of workflow automation. Expanding on past tools such as calculators and slide rules, computers eliminate enormous amounts of manual work and save time. With spreadsheets, we no longer needed to punch numbers into a calculator and write them on paper. With word processors, we can make edits in a single document rather than having to type up an entirely new version to reflect changes. Countless other examples of automated workflows, such as steps in image processing and desktop publishing software, have lifted enormous burdens from our hands and have freed us to do more creative work. However, it doesn't just end there. The time you save today is invested in making possible the more advanced tools of tomorrow. Workflow automation is a continuing step in the process.

Busting Some Myths about Automation

Many of the myths about automation might seem a little dated today, but that alone won't quell them.

Automation Will Take My Job

In today's world of gadget-crazed consumers, it's hard to imagine that only a few decades ago there was a lot of computer phobia, especially when it came to discussing automation. Many people feared that computers would end up replacing humans while they watched Captain Kirk repeatedly make computers spontaneously self-destruct by presenting them with a logical paradox.
While any technological advance can displace and even eliminate certain jobs, in the long run, it often creates far more jobs than it replaces. For example, someone has to design, build, market, sell, program, and maintain the robots that autonomously weld car frames.
If you are asked to automate a task currently performed by people, being sensitive to how the change will be viewed is certainly a good idea. Sometimes a complex solution might displace a few jobs. However, the majority of the time automated solutions are just another tool that people will use to reduce the burden of mundane and repetitive work. Artists can spend more time on the creative aspects of their jobs when they are relived from saving hundreds of images in three different sizes and formats for a Web site. Page layout experts can focus on the unique aspects of a catalog rather than tediously copying and pasting thousand of product descriptions onto catalog pages.
Note 
It is important to remember that workflow automation with AppleScript is another way of making better tools and does not automatically mean that people will lose their jobs.

Automation Will Fix Our Problems

Perhaps the worst myth of all is that automation will fix problems. We should look to automation to amplify our strengths rather than to disguise our faults.
By itself, the act of automating a process does not guarantee an improvement to the process. While automation can magnify the efficiency of a process, it can also magnify any inefficiency that may exist. If business rules are not explicitly understood, documented, and communicated for a manual workflow, a workflow automation solution can inherit those flaws. If some of the steps required to carry out a certain task are forgotten or improperly embedded into scripts, the solution will not spontaneously correct those problems. This is one of the reasons why it is advisable to begin with smaller scripts and focus on familiar tasks, and then gradually take steps to advance to more complex situations.
The more removed you are from the end user, the more danger there is of someone assuming scripts can "just do things" without explicitly stating what those things are and the rules that guide them. If the end user has never performed the tasks manually, the danger of this myth increases exponentially. Be sure that everyone understands that while your scripts might seem magical, they aren't, and that you need clear details for even the smallest step in the process you are automating.
In the decades since the invention of the personal computer, we have witnessed amazing technological solutions to many problems that brought about many great benefits. But our relatively new "age of technology" is riddled with the corpses of horribly designed solutions. The majority of the time the fault lies in the belief that if we build it, it will "just work."

I Can Automate it and Forget it

The notion that you can build a complex piece of software that endures throughout time is another dangerous myth. Custom solutions must interact with various pieces of hardware, software, and business rules that inevitably change and, therefore, require monitoring, maintenance, upgrades, and enhancements over time. With every operating system or third-party application upgrade, a scripted solution needs to be retested and tweaked to ensure that it will continue performing as designed.
Certainly, a script can be left to run autonomously and will not require as much attention as a fully manual workflow. However, creating a script that creates a catalog file does not mean the catalog will be "perfect" and not require proofing. It uses data written by people and images processed, cropped, resized, and named by people. In some cases, the result of an automated task requires more proofing to ensure that the scripts are working correctly. However, that additional proofing time may be offset many times over by the enormous time saved during assembly.

Automation is Easy

Computers are so easy to use that they sometimes spoil us a little too much. Hidden from sight in the millions of lines of code is all of the effort needed to make them work well and keep our lives so carefree. The same is true of automation, which leads us to false conclusions that automated processes are easy to build.
Another culprit for the notion that writing scripts should be easy is our own brain. People are often amazed at the time involved to build a script that will automatically do things that they take for granted. Many of the mental tasks we perform so easily are very difficult to "teach" a computer. Deciding if a photo needs to be rotated or not is an instantaneous decision we make subconsciously. Picking a color to match a color scheme in a room is, at least for some, a simple task. However, these kinds of things are nearly impossible to program into a script.
Note 
To write a script, you need to know every detailed step in the process, including all the decision-making logic that users might take for granted.

Automation Will Make Us Appear Less Personal with Clients

The idea that automation shows or requires a lack of concern for personal interaction with clients or vendors is another common myth. Those who believe this fallacy have had too much exposure to poorly developed solutions. Everything from voice-mail systems that seem to be designed to keep us from every reaching a human being to cryptically formatted e-mails with "Do not reply" stamped in them makes some people leery of automating their interactions with their clients. However, these failures should be used as an inspirational call to arms.
Tip 
Any poorly implemented solution can certainly appear cold and impersonal. However, if done well, automated solutions can present you and your company as a technologically proficient and efficient vendor, which is always a plus. Most of the time, automated solutions can be completely concealed from view.
A piece of technology, by itself, isn't impersonal. It all depends on how you use it. When the telephone was first introduced, there were probably some who complained that it reduced face-to-face meetings. However, it also enabled people to "meet" more often. E-mail likely raised the same fears initially, but now it's clear how it has dramatically increased the amount of information we can quickly communicate.
Databases need to operate with a serial number assigned to each client. However, that doesn't mean you should forget your client's name and refer to the client only by the number.
Automation doesn't automatically turn a company into a cold, uncaring box. Instead, it makes possible a new level of personalized client communication. Product announcements can be created based on a client's individual profile, giving them a brochure specifically designed for them. Customized project status reports can be created to keep the client up to date and well informed about their project. Using a person's name in the Reply To address and taking care to format the data in a friendly, easy-to-read manner should just be common sense.

Exploring Reasons to Automate a Workflow

Automated solutions are, in a lot of ways, just like any other cost-saving policy a company might adopt. They can save time and reduce costs while increasing quality and capacity. However, unlike some new and oppressive rules and regulations dreamed up by "efficiency consultants," automation can achieve these goals while simultaneously reducing stress, improving morale, and allowing staff members to focus on more rewarding creative work rather than mundane, repetitive chores. In this way, well-designed workflow automation solutions can be mutually beneficial for both a company and its employees. Rather than viewing cost saving directives as punitive, employees and their company can use automation to obtain the same goals in a more rewarding way.

Improve Consistency

One of the first things to be affected when people are overworked is consistency. It is hard to step back and look at the big picture when you are crunching out a batch of files as quickly as possible. The thought of stopping just to remind yourself of a naming convention for Web site files or the correct column order for a sales report can be grueling when the clock winds down and you still have dozens of items on an urgent to do list.
An automated solution with all the company business logic correctly encoded within it applies those conventions every single time it executes, and does so dispassionately. Many human errors caused by fatigue, stress, or carelessness magically disappear.

Improve Quality

Automation can have a huge effect on quality. When a script frees employees from frantically working through lists of manual chores to meet a deadline, they can spend more of their time thinking about how they work and discovering new areas where automation might help improve their jobs. In short, they can focus on quality.
For example, if a script automatically assembles desktop publishing files, the layout designer can focus more attention on fine-tuning the master pages, style sheets, and artwork of the template. If a photographer doesn't have to manually save each photo in ten different sizes, each in a different file format and with a different naming convention, she is free to spend more time tweaking her photographs before sending them on to the next department.

Increase Project Size and Capacity

Automation also can make it possible to increase the size and capacity of projects. New services that are prohibitively labor intensive suddenly become a possibility. Because a computer can run constantly day and night, and on weekdays, weekends, and holidays, it can be continually building, processing, informing, and managing a variety of automated tasks from a massive queue in a folder. Massive tasks can be assigned to a fleet of automated servers, each responsible for one or more of a group of automated tasks.
Note 
When a script cuts the effort required for a particular project by some significant percentage, additional projects loaded onto the same staff are not as oppressive as they would be without automation.

Reduce Stress

Stress is a human response to adverse conditions. In business, people can experience elevated levels of stress when they have too much pending work, are too close to a deadline, or do not have the proper tools to complete the work. Under stress, people often begin to rush, cut corners, forget procedures, make typos, and worse.
The most common "solution" to such a situation is to reduce an employee's workload. Automation makes it possible to shift the focus to tools that allow the work to be completed more easily, creating less of a burden on an employee.
Scripts can help remind, encourage, and even autonomously enforce naming and other business conventions. They work tirelessly to perform routine tasks while the user is out to lunch, in a meeting, or at home for the evening. An inbox full of messages informing you that your documents have been successfully processed and are now waiting for your review is far more welcoming than strict and ominous reminders that you have work due.
Well-designed automated solutions can be a huge stress relief to every user involved in a given workflow.

Encourage Employee Innovation

Sometimes people hide in their cubicles, never making any suggestions for improvements because they don't want to create more work for themselves or others. Any suggestion for improvement to a company's products, services, or some part of their workflow often results in more work for someone, usually the one with the idea.
Workflow automation can have an opposite effect, making employees fountains of innovative ideas. Once users realize that automation creates tools that help them be more valuable employees while doing less manual work, their enthusiasm for innovation may be difficult to contain.

Wednesday, July 20, 2011

Workflow Automation with AppleScript

Before delving into the intricate details of designing, developing, and deploying AppleScript workflow solutions, take a step back and consider the various ways the solution might be used in the future. Such reflection will give you a much richer grasp of the benefits of AppleScript and what it can help you achieve.
workflow is an ordered sequence of individual steps that are performed together to achieve an overall task. Although the term can refer to any task, in this chapter, only tasks performed on a computer are relevant.
Before you can automate a workflow, you need to abstract the workflow steps from the other unrelated tasks with which they intersect. You must also delimit your focus to avoid being caught up in the folly of automating everything.
For example, suppose you were presented with the challenge of automating a catalog production workflow. At first it might sound easy. After all, there are only three or four steps. Material is created, placed into a page layout document, proofed, and then converted into a portable document format (PDF) file for print. However, each of these steps can be considered an entire workflow on its own. The text and images that eventually find their way into a page layout program might go through dozens of steps, from concept to completion, before getting to the page layout step. Further, some of the steps that occur during concept and completion might be defined as separate, smaller workflows. If you reduced the entire process down into the smallest individual steps, there might be thousands or millions of them.
When defining a workflow for eventual automation, it is important to focus on a reasonable portion of the "big picture" process. But you also need to choose processes that lend themselves to automation. Appropriate processes must have a lot of repetitive activity and not a great amount of creativity. Writing a script that places and styles text according to static business rules is a much more sensible choice for automation than trying to make a script perform the creative writing process necessary to generate the text in the first place.
Another factor to consider when searching for a workflow to automate is who performs the work manually. If your script will perform a handful of functions that you or your co-workers currently do manually, there isn't much to consider. However, some workflows might involve tasks performed by dozens of people. Those people might work for the same company or be diverse members of different companies, offices, departments, or disciplines. In such a case, you must consider the human factor as part of your definition of the workflow to ensure that you don't try to automate a workflow with a single script that must somehow pause and wait for people to perform a few steps. Instead, there should be multiple scripts, one for each discrete portion of the work. In essence, you want to automate tasks "between" people and not "through" them.
It can be a challenge to untangle a process from all the other processes and the people involved while simultaneously considering all the variables. Successful developers need to be able to alternate their focus from the isolated details of a process and the full context in which it exists. This skill is crucial for developers defining a workflow for automation.