• 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
Loop to erase the contents of my logs ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Loop to erase the contents of my logs ...


  • Subject: Loop to erase the contents of my logs ...
  • From: Charles Heizer <email@hidden>
  • Date: Tue, 10 Jun 2003 09:57:16 -0700

Hello,
I'm stuck. I'm trying to write a small apple script to clear the contents of all of my logs before I image my system, but I keep hitting a wall. I can do this with a foreach statement using a shell script but I wanted to find out how to do it with applescript.

Thanks,

- Charles


Here is my code --

property attributes : {}
property multiple : 1

set logLoc to "/private/var/log3"
set logLoc to (POSIX file logLoc) as Unicode text
tell application "Finder"
set logLoc to name of every file of folder logLoc whose name ends with ".log"
end tell

repeat multiple times
repeat with c in logLoc
set end of attributes to {c}
end repeat
end repeat
activate
repeat with i in attributes
set theLog to item 1 of i
set theLog to open for access theLog with write permission
set eof theLog to 0
close access theLog
end repeat
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Loop to erase the contents of my logs ...
      • From: Christopher Nebel <email@hidden>
    • Re: Loop to erase the contents of my logs ...
      • From: Andrew Oliver <email@hidden>
  • Prev by Date: Re: Date math question
  • Next by Date: list coersion...
  • Previous by thread: [ANN] Defaults Manager
  • Next by thread: Re: Loop to erase the contents of my logs ...
  • Index(es):
    • Date
    • Thread