• 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
Moving man files gives out of memory error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Moving man files gives out of memory error


  • Subject: Moving man files gives out of memory error
  • From: email@hidden
  • Date: Wed, 25 Jul 2001 11:16:07 -0500

Hello all,

I have written a script to move files from one folder to another on the same
drive using a text list to direct each file to its new folder. If the
destination folder does not exist, a new folder is created. This works great
until the process tries to run over 2500 files which gives me an error "of
out of memory". I have increased the memory allocated to 400MB and I still
get an "out of memory". I need to run this on a folder containing over
18,000 images. Is this too much for Applescript to handle?

Here is the portion of the script that opens the text file and puts it into
a list and the repeat loops to check for destination folder and then move
the file:

set data_file to (choose file with prompt "Select text file of file names:"
of type {"TEXT"}) as string
open for access alias data_file
set the_list to {}
set prev_folder to {}
set the_list to (read alias data_file as {text} using delimiter
{return})
close access alias data_file

repeat with full_file_name in the_list
try
set old_delim to AppleScript's text item delimiters
set AppleScript's text item delimiters to ":"
set folder_name to text item 1 of full_file_name
set AppleScript's text item delimiters to old_delim
on error
set AppleScript's text item delimiters to old_delim
end try
if folder_name is not prev_folder then
make new folder at folder "COMPS1" of folder "Moved
Files" of disk "Firewire 75000" with properties {name:folder_name}
set view of container window of folder folder_name
of folder "COMPS1" of folder "Moved Files" of disk "Firewire 75000" to name

set prev_folder to folder_name
end if
end repeat

repeat with full_file_name in the_list
try
set old_delim to AppleScript's text item delimiters
set AppleScript's text item delimiters to ":"
set folder_name to text item 1 of full_file_name
set file_name to text item 2 of full_file_name
set AppleScript's text item delimiters to "."
set file_name_no_ext to text item 1 of file_name
set AppleScript's text item delimiters to old_delim
on error
set AppleScript's text item delimiters to old_delim
end try
set target_file to "Firewire 75000:COMPS1:" &
file_name_no_ext & ".JPG"
move file target_file to folder folder_name of folder
"COMPS1" of folder "Moved Files" of disk "FireWire 75000"
end repeat

The data file was saved out of Word as a text file with each record
containing the folder name:filename.ext.

Any suggestions would be appreciated.

Thanks,
Celli


  • Prev by Date: Trying to pass file path from a.s. droplet to MacPerl code in the droplet
  • Next by Date: Re: Trying to pass file path from a.s. droplet to MacPerl code in the droplet
  • Previous by thread: Re: Trying to pass file path from a.s. droplet to MacPerl code in the droplet
  • Next by thread: Alternate download location for XCMD OSAX?
  • Index(es):
    • Date
    • Thread