Skip to Content
Beginning AppleScript®
book

Beginning AppleScript®

by Stephen G. Kochan
December 2004
Beginner
600 pages
13h 42m
English
Wrox
Content preview from Beginning AppleScript®

13.7. Scripting Additions

When you learned how to examine the Standard Additions dictionary in Chapter 4, I briefly mentioned the term osax, which stands for Open Scripting Architecture extension. The Standard Additions osax is stored on your system in the folder /System/Library/ScriptingAdditions under the file name StandardAdditions.osax. Because the Standard Additions is available on all Mac OS X systems, the commands in this text have been treated as an integral part of the AppleScript language. A scripting addition can be written by anyone. After an addition is installed in your ScriptingAdditions folder, the addition's commands and terms become immediately available for use in your AppleScript programs, as if they were built into the language.

Satimage is a company that offers several scripting additions. These include a math addition that provides arithmetic and transcendental functions; a text addition for performing search and replace operations and formatting numbers; a files addition that enhances some of the Standard Additions commands; and a regular expressions addition for working with regular expressions.

As an example, the Satimage osax contains a command called change that performs a search and replace on a character string. By placing that osax file into the ScriptingAdditions folder, I can write a command like this directly in my program:

change " " into "X" in "This is a test of the Emergency Broadcast System"

This changes all occurrences of a space character ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Take Control of Your M-Series Mac

Take Control of Your M-Series Mac

Glenn Fleishman
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer

Publisher Resources

ISBN: 9780764574009Purchase book