Jump to content

Use applescript to edit kexts?

3 posts in this topic

Recommended Posts

Can you use Applescript to edit kexts?


I know you can open terminal and run a command, but what happens when you sudo and have to verify the password? Does it just popup so you can enter the password and then go on its merry way?


I believe there is a way to get terminal to change lines of text without having you manually select them with pico, is this correct? Ive seen people use "sudo perl" to automate the whole kext process which seems to replace certain strings by typing something like: 's/0x11111/0x22222/g'


Tell Application "Terminal"
do script "sudo perl -pi -e 's/xx/xx/g' /system/etc"
end tell


Would that edit kexts? Im mostly confused about the perl commands, Ive only seen it in certain threads, I havent actually been able to use it with my hardware.

Link to comment
Share on other sites

  • 1 year later...

You don't actually need to tell Terminal to do this. To run a shell command as root, all you need to do is:


do shell script "whatever the command" with administrator priveleges


This will prompt you with the standard OS X authentication dialog box.


You can also specify the user and password if you're trying to script something specific to your computer.


do shell script "command" user name "me" password "mypassword" with administrator privileges

Link to comment
Share on other sites


  • Create New...