Name
Memory Control Panel
Dictionary commands
- close
This command closes the Memory control panel, as in:
tell app "Memory" to close
-
count
reference Use this property to count the elements of a class:
tell app "Memory" to count available disks
This code fragment returns the number of disks the computer could use for virtual memory. count returns an
integervalue. See theavailablediskclass.-
each
type class You can also use the syntax:
count each available disk
This usage returns the same value as:
count available disks
-
each
- use default settings
If you use the following code, the control panel will set Disk cache, virtual memory, and RAM disk to default values (e.g., the default value for a RAM disk is “off “):
tell app "Memory" to use default settings
Dictionary classes
-
application This class represents the Memory control panel. It has one element,
available disk, as in:get available disks
This returns a value that looks like:
{Disk Volume "Macintosh HD" of application "Memory", Disk Volume "H2gig" of application "Memory", Disk Volume "HB2gig" of application "Memory", Disk Volume "scratch" of application "Memory"}The Memory
applicationcan also get or set various features of disk caches, virtual memory, and RAM disks. This code example finds out thestateofvirtual memory(activeif VM is enabled on one of the local disks) and thesizeof VM:tell application "Memory" set VMOn to state of virtual memory set VMsize to size of virtual memory display dialog "The state of VM ...
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