• 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
Making a log file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Making a log file


  • Subject: Making a log file
  • From: "Timothy K. Wilkinson" <email@hidden>
  • Date: Thu, 01 Mar 2001 10:41:13 -0500

I'm trying to create an application that will log a user's id on our lab
machines to a SimpleText file. We just want to track which users are using
what machines. I've got a script that does everything I want it to do
except one thing. It will only write one line of information. It replaces
the information at the top of the file every time a new user logs in. It
seems like this should be an easy thing to do with AppleScript but I can't
seem to make it work. How do you make AppleScript return and append a new
line of information to a text file every time it's used?

Here's the script I'm using. It uses Akua Sweets's "compile list" feature:

tell application "Finder"
set loginFile to "Macintosh HD:login.txt"
set lineCount to (count of lines in loginFile)
display dialog "Please enter your UVA ID:" default answer "" buttons
"OK" default button "OK"
set userID to text returned of result as text
set cname to (owner name) as text
set cDate to (current date) as text
set loginInfo to (compile list {userID, cname, cDate} with row delimiter
tab with column delimiter return)
write loginInfo to loginFile
end tell


Any help is much appreciated.


Tim Wilkinson
ITC-ACHS
University of Virginia
email@hidden
email@hidden


  • Follow-Ups:
    • Re: Making a log file
      • From: Emmanuel <email@hidden>
    • Re: Making a log file
      • From: Sander Tekelenburg <email@hidden>
  • Prev by Date: Facespan App Help
  • Next by Date: Re: Subject title censorship
  • Previous by thread: FaceSpan App Help
  • Next by thread: Re: Making a log file
  • Index(es):
    • Date
    • Thread