Loop to erase the contents of my logs ...
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.