Help with start shell script with administrator privileges...

Hey everyone-

This is my first post, and I’ve been searching around for a while trying to fix my code so the shell script starts with admin priv, any assistance is greatly appreciated!

Here’s the code:



tell application "Terminal" 						
  if (count of windows) is 0 then 						
     do shell script "set +x;clear;" & quoted form of ftkconsole01 & " /dev/" & drivechoice01 & " " & quoted form of destinimage & " --no-sha1 --frag 700M --examiner " & quoted form of examiner01 & " --compress 1;
stty -echo
clear
echo 
echo --------------------
echo Your Collection is Finished
echo Please Press End Collection
echo --------------------
echo 
exit;" with administrator privileges 						

else 						
     do script with command "set +x;clear;" & quoted form of ftkconsole01 & " /dev/" & drivechoice01 & " " & quoted form of destinimage & " --no-sha1 --frag 700M --examiner " & quoted form of examiner01 & " --compress 1; 
stty -echo 						
clear 						
echo  						
echo -------------------- 						
echo Your Collection is Finished 						
echo Please Press End Collection 						
echo -------------------- 						
echo  						
exit;" in window 1 						 			

end if 						
activate 						
tell application "Finder" to set visible of process "Terminal" to true 				
end tell



As you can see, I attempt to run the script with command, in terminal, in a new window, or if one is already opened. I changed the first part (top) and was able to get it to run correctly (prompting for admin privileges). The bottom part is untouched but when i tried to make the same changes to the bottom part, applescript editor barks are me and i think it has to do with the last part “in window 1” that messes it up when trying to add “with administrator privileges”

Any ideas? Should i put the commands in a seperate script file and call it that way? If so, what are some examples? Thank you!

Ryan

What are the ‘ftkconsole01’, ‘drivechoice01’, ‘destinimage’, and ‘examiner01’ variables? I cant test your script without them