Skip to Content
AppleScript in a Nutshell
book

AppleScript in a Nutshell

by Bruce W. Perry
June 2001
Intermediate to advanced
526 pages
16h 29m
English
O'Reilly Media, Inc.
Content preview from AppleScript in a Nutshell

Chapter 29. Memory and Mouse Control Panels

If you are a programmer who likes to tinker with various memory settings, such as turning virtual memory on and off or adjusting the disk-cache size, then the scriptable Memory control panel is right up your alley. This control panel (see Figure 29-1) controls three aspects of computer memory usage, all of which are scriptable:

Disk cache

The operating system reserves a certain amount of Random Access Memory (RAM) for the storage of frequently used bits of data. This repository is called a disk cache. By default, your disk cache is set to 32 KB times the amount of megabytes of physical RAM you have. My disk cache is set to 6656 KB, or 32 KB times 208 MB. This size is adjustable via AppleScript (see the application class description later in this chapter).

Virtual memory

A portion of your hard disk the operating system uses as if it were RAM is called virtual memory (VM). This increases the computer system’s available memory; however, VM slows down the use of some programs and uses up space that could be used to store files. AppleScript can turn on and off or adjust the size of VM.

RAM disk

A RAM disk is a part of memory that can be used like a disk for storing files. It is the opposite of virtual memory, which uses a disk to act like memory. An icon for the RAM disk shows up on your desktop, and you can drag folders and files onto it. A RAM disk persists through a computer restart, but its contents are erased on some Mac systems if the ...

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

AppleScript: The Missing Manual

AppleScript: The Missing Manual

Adam Goldstein
Beginning Mac OS® X Programming

Beginning Mac OS® X Programming

Michael Trent, Drew McCormack

Publisher Resources

ISBN: 1565928415Errata Page