Some months (and months) ago, someone in this group was kind enough to help me set up a script which would write the current date and time to a text file. Everything has been working great, but something has happened which I cannot explain, as I discovered when I tried to use the script just now.
I have upgraded from OS 9.0.4 to 9.1 since the script last worked, if that could have had an effect. I have searched the archive and can’t find any mention of the previous messages.
Can someone tell me what has happened to this script? What it should say?
set jobLog to “HD:Documents:Job Log”
set theDate to («event misccurd») as text
«event rdwropen» file jobLog with «class perm»
set the_eof to («event rdwrgeof» file jobLog)
«event rdwrwrit» (date string of («event misccurd») & tab & time string of («event misccurd») & tab) given «class refn»:file jobLog, «class wrat»:(the_eof + 1)
«event rdwrclos» file jobLog
Are your FIVE security modules safeguarded at Extensions folder?
Is your “Standard Additions” osax at Scripting Additions folder?
“misccurd”, “rdwrgeof” and those raw guys are part of standard additions and seems that they are not active or, at least, applescript can’t communicate them :rolleyes:
Have you tried to recompile the script? If so, and that didn’t work, I’d copy and paste it into a new Script Editor window and see if things straighten out.
Here’s what it should look like:
set jobLog to "HD:Documents:Job Log"
set theDate to (current date) as text
open for access file jobLog with write permission
set the_eof to (get eof file jobLog)
write (date string of (current date) & tab & time string of (current date) & tab) to file jobLog starting at (the_eof + 1)
close access file jobLog