Here’s what I’m working on…I’ve got a program that constantly needs these files to be updated, so I’ve decided to write a script to delete them and replace them each time the program is run. the problem is that I’m on a school campus and the computers in the teacher’s rooms are not logged in with administrative rights.
Is there a way to include in the script an administrator’s login so that the files can be deleted and replaced without having to log out and log back in?
tell application "System Events"
try
if (exists disk "accelerated-reader") then
set Volume_present to yes
else
set Volume_present to no
end if
end try
end tell
if (Volume_present is equal to no) then
tell application "Finder"
mount volume "afp://highland-file/accelerated-reader"
end tell
end if
tell application "Finder"
delete "Macintosh HD:System Folder:Preferences:alsbigc.dat"
delete "Macintosh HD:System Folder:Preferences:alsbigc.fpt"
empty trash
duplicate file "Accelerated-Reader:ALSDATA:alsbigc.dat" to "Macintosh HD:System Folder:Preferences"
duplicate file "Accelerated-Reader:ALSDATA:alsbigc.fpt" to "Macintosh HD:System Folder:Preferences"
end tell
tell application "Accelerated Reader® Student"
run
end tell
end tell
tell application "Accelerated Reader® Student"
run
end tell
Thanks,
Patrick