At 10:46 am +0100 9/10/03, Alan Fry wrote:
I have a MacPerl script I am trying to transfer from OS9 to OSX.

There are two problems: cron and a progress bar.

Regarding 'cron', the perl script is kicked off by an AS application, so the problem really is how to get the AS application to run at specific times.

The second problem is how to replace the MacPerl Progress Bar in OSX perl.


As to the scheduling, if you're not going to use cron or some third party utility to launch the application, then you can run the application as stay-open with an idle handler such as the script below.

As to the "progress bar", I'd need to know what you mean.



property _times : {"06:45am", "12:20pm", "12:35pm"}
property _midnight : "0"

---idle --uncomment to test

on idle
 set _now to (current date) - (get date _midnight)
 repeat with t in _times
  set _alarm to (date t) - (get date _midnight)
  set _difference to _alarm - _now
  if _difference is less than 0 and ¬
   _difference is greater than -2 * minutes then
   doThis()
   return 2 * minutes --(rerun idle in 2 minutes)
  end if
 end repeat
 _alarm
end idle
on doThis()
 do shell script "perl -e ' $f = qq~/tmp/date.txt~ ;
open F, qq~>$f~ ; print F scalar localtime ;
`open -e $f` ;  '"
end doThis

Reply via email to