• 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
Logging Events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Logging Events


  • Subject: Logging Events
  • From: Ted Wood <email@hidden>
  • Date: Wed, 13 Dec 2000 16:23:18 -0800

At 12:04 PM -0800 13/12/00, "Randy Fingeroot" <email@hidden> wrote:
I'm working on a script to help troubleshoot a problem we've occasionally
had. I'd like to have a log for each time a user uses the script with the
results of the application. Anybody got any tips?

Hi Randy,

Let me see if I follow you. The problem you've been experiencing is with the script in question? Or another application?

Basically, you can have the script save the results to a text file, along with the current time and date that execution took place.

I suggest using the Read/Write osax for this purpose. You just need to specific the target log file and the rest is easy. Take a look:

-- add this code to your script: --

set logFile to (open for access path_name_of_log_file with write permission)
set fileLength to (get eof logFile)
write (return & ((current date) as string) & " - " & resultFromApp as string) ,
to logFile starting at fileLength + 1
close access logFile


where path_name_of_log_file is a complete path to the log file for saving results;
and resultFromApp is the result you want to save to the log file.

Give it a try and let me know how it goes. =)

Ted


  • Prev by Date: Re: Does AppleScript have arrays within the language?
  • Next by Date: Re: info for file help...
  • Previous by thread: Re: Newbie FaceSpan/Applescript question
  • Next by thread: AScript Editors?
  • Index(es):
    • Date
    • Thread