Login as root then code for unix

Ah login code… i got

tell application "Finder"
	activate
	open application file "Terminal.app" of folder "Utilities" of folder "Applications" of startup disk
	do shell script "sudo su"
end tell

but how do i type password?
then i can do the other commands just dunno how to type the password.

Hi,

the following line is sufficient, opening the terminal is not needed

do shell script "/usr/bin. " with administrator privileges

– no sudo!!
if you want to preset user name and password, use

do shell script "/usr/bin. " user name "myself" password "¢¢¢¢" with administrator privileges

btw, this code


tell application "Finder"
   activate
   open application file "Terminal.app" of folder "Utilities" of folder "Applications" of startup disk
end tell

is the same as

activate application "Terminal"

The Finder is not needed at all to launch an application

yea i just deleted that… i did the record button. Havent done applescript in a while.

i get an error…

so heres what i got


tell application "Terminal"
	activate
	do shell script "/usr/bin. " with administrator privileges
	tell application "Terminal"
		do script "/Applications/xampp/xamppfiles/mampp restart" in window 1
	end tell
end tell

a shell script line with “administrator privileges” mustn’t be within an application tell block

no, oh my god ;):wink:

do shell script "Applications/xampp/xamppfiles/mampp restart" with administrator privileges

nothing else!!

ok good but ah this code is goin 2 be done threw ssh
so like i just wanna open the script application and let it run.

Sorry, I’m not familiar with ssh

ok it’s remote control. So like i need somthin that i can do 1 code " open -a untilted.app" then let it run

ok i got it :slight_smile: