The computers in my school’s TV journalism class have installed on them iMovie 4 and Final Cut Pro 4. Turns out when you install Final Cut it adds files that keep iMovie from communicating with a DV camera. So I wrote a script that when run would move the files out of the Library folder they are installed in to a folder on the top level of the hard drive then restart the computer. The script runs great…on root. On any other user it asks for an admin name and password for each file, which defeats the whole purpose of the script which was to keep them from having to call me whenever they needed to export. (it says it needs an admin to authorise modifying the Finder) Is there anyway on the restricted users to automatically authenticate or just skip the authentication completely?
set fileUno to "Untitled:Users:Joshua:Desktop:A:File1.rtf"
try
alias fileUno
tell application "Finder" to move "Untitled:Users:Me:Desktop:A:File1.rtf" to "Untitled:Users:Me:Desktop:B:"
on error --> file doesn't exist
tell application "Finder" to move "Untitled:Users:Me:Desktop:B:File1.rtf" to "Untitled:Users:Me:Desktop:A:"
end try
display dialog "Restart now?" buttons {"Cancel", "OK"} default button 2
set fileDos to "Untitled:Users:Joshua:Desktop:A:File2.rtf"
try
alias fileDos
tell application "Finder" to move "Untitled:Users:Me:Desktop:A:File2.rtf" to "Untitled:Users:Me:Desktop:B:"
on error --> file doesn't exist
tell application "Finder" to move "Untitled:Users:Me:Desktop:B:File2.rtf" to "Untitled:Users:Me:Desktop:A:"
end try
display dialog "Restart now?" buttons {"Cancel", "OK"} default button 2
tell application "Finder" to restart
that’s not exactly what I have, that’s what I did on my home computer when learning how to write the script (it’s actually my first time using AppleScript; I’ve used similar languages before but never this one). The one at school has different file names and locations and the last two lines are different I think, but that doesn’t really matter.