help - its so close...
help - its so close...
- Subject: help - its so close...
- From: Andrew Simpson <email@hidden>
- Date: Fri, 14 Sep 2001 11:35:38 +1200
would it be possible for someone to help me explain this a bit better
because i am feeling a bit slow today
what i am trying to do is the following:
copy certain types of files from disk/shuttle to local drive
open the files with an adobe action that rasterizes the images and
manipulates them and prepares it for the web
copies the completed file from a directory that adobe puts the file into
onto a network drive
now i have this all working beautifully, well i think it is anyway but it is
all happening to fast and images are getting deleted before images are
finished with and so on an so forth.
some one posted some code to help out with the delay until the current
action is complete stuff, but i can't get it to work. i'm also lost on what
the hell is up with the try: end try: blocks and would prefer not to use
them as its going to cause problems.
would somebody have a look at the code below and maybe help me out with some
of the timing issues i have...
----code------
--Moves files all into the processing directory
on walkMe(nextFolder, target_folder, final_resting_place, processed_folder)
try
tell application "Finder"
set folderList to every item of nextFolder
end tell
repeat with newFile in folderList
set tempFileType to the file type of newFile
set tempFileName to the name of newFile
if tempFileType is "fold" then
--shrink images as we go to ensure enough space
tell application "Finder"
activate
set file_list_to_process to every file of target_folder
as list
repeat with i from 1 to count of items in
file_list_to_process
select item i of file_list_to_process
with timeout of 5 * 60 seconds
open selection using file "Andrew web reduce"
--adobe action droplet
my isitsafe(item i of file_list_to_process)
end timeout
end repeat
delete every file of target_folder
empty trash
set file_list_to_copy to every file of processed_folder
as list
repeat with i from 1 to count of items in
processed_folder
select item i of processed_folder
with timeout of 1 * 60 seconds
copy selection to folder final_resting_place
end timeout
end repeat
end tell
walkMe(newFile, target_folder, final_resting_place,
processed_folder)
else
if tempFileType is equal to "EPSF" then
if tempFileName ends with ".eps" then
tell application "Finder"
select newFile
with timeout of 180 seconds
try
copy selection to folder target_folder
end try
end timeout
end tell
end if
end if
end if
end repeat
end try
end walkMe
on isitsafe(fileName)
tell application "Finder"
activate
display dialog "Got to 5 with " & fileName
repeat while (busy of (info for fileName))
delay 1
end repeat
end tell
end isitsafe
tell application "Finder"
activate
set the folder_to_search to choose folder with prompt "Choose a mounted
volume with processable images."
set target_processing_folder to choose folder with prompt "Choose folder
on local drive to process images."
set final_resting_place to choose folder with prompt "Choose folder on
remote drive to place compressed images."
set processed_folder to choose folder with prompt "Choose the folder
that the PhotoShop action will place the images"
try
empty trash
end try
my walkMe(folder_to_search, target_processing_folder,
final_resting_place, processed_folder)
end tell
----End Code----
thanks for anyone who attempts to wade through the mess above