You may want to describe what problems you are trying to solve. There could be a better way of doing what you want.
"will purge system memory" doesn't sound right to me. Mac OS X make use off all the memory it can. Any excess memory is used to store copies of applications that you have quit, so if you restore the appl it will load faster.
Anyway, here is an applescript with root access which you could invoke from automator:
(*
It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on. Here is an example.
Author: rccharles
For testing, run in the Script Editor.
1) Click on the Event Log tab to see the output from the log statement
2) Click on Run
For running shell commands see:
http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
*)
on run
-- Write a message into the event log.
log " --- Starting on " & ((current date) as string) & " --- "
-- debug lines
set unixDesktopPath to POSIX path of "/System/Library/User Template/"
log "unixDesktopPath = " & unixDesktopPath
set quotedUnixDesktopPath to quoted form of unixDesktopPath
log "quoted form is " & quotedUnixDesktopPath
try
set fromUnix to do shell script "sudo ls -l " & quotedUnixDesktopPath with administrator privileges
display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
on error errMsg
log "ls -l error..." & errMsg
end try
end run