Stay Open Script Won't Quit
Stay Open Script Won't Quit
- Subject: Stay Open Script Won't Quit
- From: Eric Schult <email@hidden>
- Date: Mon, 08 Oct 2001 15:30:29 -0500
I have a stay open script that every hour triggers a series of external
scripts that can each take 5-15 minutes to run. The purpose of the script is
to check for the presence of EPSes in a list of folders and do such things
as convert them to PDFs, extract text from the PDFs, GIF the PDFs, FTP the
GIFs to a web server, and build a searchable online database of all the
GIFs. It's a very CPU-intensive exercise, but it works pretty flawlessly.
The problem comes when I want to interrupt the scripts from running so that
I can perform manual tasks on my dual processor G4 (still running OS 9.1).
Depending upon whether the stay open script is in idle or not, and whether
one of the external scripts is running or not, I often can't quit the
processing. If I bring the stay open app to the foreground while an external
script is running, I can't select "Quit" from the File scroll-down menu,
because the selection is greeked. Hitting command-period to stop the
external script doesn't seem to do the trick, either.
What follows is the stay-open script in its entirety. It's not too complex.
It's the external (Distiller, Photoshop, Anarchie) scripts that are
involved. Can anybody suggest a solution that'll let me escape this problem?
Thanks!!
WES
AdTracker:Scripts:AdTracker Server Scripts:Set AdTracker Server Properties"
property setProperties : "JT AdTracker:Scripts:AdTracker Server Scripts:Set
AdTracker Server Properties"
property pdfInFolder : ""
property checkEPSes : ""
property GIFthePDFs : ""
property extractText : ""
property idleTime : 60 * 60
property previousScript : "none"
on run
tell application "Finder"
activate
display dialog "Launching Keep Checking All \"Stay Open\" script
..." with icon note giving up after 5
end tell
end run
on idle
(* LET USER KNOW WHAT'S HAPPENING. *)
tell application "Finder"
(* GET NECESSARY PROPERTIES BY RUNNING THE EXTERNAL "SET PROPERTIES
..." SCRIPT. *)
try
run script file setProperties
on error
activate
display dialog ,
"Couldn't run the \"Get Properties ...\" external script."
buttons {"Cancel"} with icon stop
end try
end tell
set getProperties to load script file setProperties
set epsFolders to epsFolders of getProperties
set pdfInFolder to pdfInFolder of getProperties
set pdfOutFolder to pdfOutFolder of getProperties
set adStatusFolder to adStatusFolder of getProperties
set displayOptionalDialogs to displayOptionalDialogs of getProperties
set displayDuration to displayDuration of getProperties
set checkEPSes to checkEPSes of getProperties
set GIFthePDFs to GIFthePDFs of getProperties
set extractText to extractText of getProperties
-- if previousScript is not "checkEPSes" then
run script file checkEPSes
-- set previousScript to "checkEPSes"
-- end if
tell application "Finder"
set epsCount to count of items in (folder pdfInFolder whose (file
type is "EPSP" or file type is "EPSF"))
if epsCount > 0 then
activate
display dialog "There are " & epsCount & " EPSes in your
Distiller \"In\" folder." & return & return & ,
"GIF conversions will not proceed until Distillation is
complete." with icon note giving up after 5
return idleTime -- wait for Distiller to finish processing EPSes
into PDFs
end if
end tell
run script file GIFthePDFs
-- set previousScript to "GIFthePDFs"
run script file extractText
return idleTime
end idle
on quit
-- set previousScript to ""
continue quit
end quit