slacker
January 18, 2008, 2:09pm
#1
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.
StefanK
January 18, 2008, 2:37pm
#2
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
slacker
January 18, 2008, 2:47pm
#3
yea i just deleted that… i did the record button. Havent done applescript in a while.
slacker
January 18, 2008, 2:53pm
#5
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
StefanK
January 18, 2008, 2:53pm
#6
a shell script line with “administrator privileges” mustn’t be within an application tell block
StefanK
January 18, 2008, 2:55pm
#7
no, oh my god ;)
do shell script "Applications/xampp/xamppfiles/mampp restart" with administrator privileges
nothing else!!
slacker
January 18, 2008, 3:00pm
#8
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.
StefanK
January 18, 2008, 3:03pm
#9
Sorry, I’m not familiar with ssh
slacker
January 18, 2008, 3:08pm
#10
ok it’s remote control. So like i need somthin that i can do 1 code " open -a untilted.app" then let it run