• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: preferred memory size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: preferred memory size


  • Subject: Re: preferred memory size
  • From: JollyRoger <email@hidden>
  • Date: Sun, 20 Jan 2002 19:49:21 -0600

On 1/20/2002 10:52 AM, "Nicholas E. Baker" <email@hidden>
wrote:

> hello all,
> is it possible to set an application's preferred memory size via an
> applescript?

Yep. Note that the pre-Mac OS 8 Finder expects the size in *bytes*, while
the Mac OS 8+ Finder expects the size in *kilobytes*. I use the following
handler to set the preferred memory size in my scripts:

-- begin script
-- set ircle's memory partition to 5000 K
my SetPreferredMemorySize("prfC", 5120000)

on SetPreferredMemorySize(appCreator, numBytes)
try
tell application "Finder"
set finderVersion to version
set majorFinderVersion to the first character of finderVersion
set currentSize to total partition size of application file id
appCreator
if currentSize < numBytes then
-- change mem size
if majorFinderVersion < 8 then
-- before Mac OS 8, specify bytes
set total partition size of application file id
appCreator to (numBytes)
else
-- Mac OS 8+, specify kilobytes
set total partition size of application file id
appCreator to (numBytes div 1024)
end if
end if
end tell
on error errmsg number errnum
return ("SetPreferredMemorySize(" & appCreator & ", " & numBytes &
") = " & errnum & ": " & errmsg)
end try
end SetPreferredMemorySize
-- end script

Enjoy.

JR


  • Follow-Ups:
    • Re: preferred memory size
      • From: "Nicholas E. Baker" <email@hidden>
    • Re: preferred memory size
      • From: JollyRoger <email@hidden>
References: 
 >preferred memory size (From: "Nicholas E. Baker" <email@hidden>)

  • Prev by Date: Re: preferred memory size
  • Next by Date: Re: styled text
  • Previous by thread: Re: preferred memory size
  • Next by thread: Re: preferred memory size
  • Index(es):
    • Date
    • Thread