Help with "do shell script" in Applescript

Posted:
in Genius Bar edited January 2014
This is my script:

Code:


do shell script "chmod +x /System/Library/CoreServices/Dock.app.DISABLED/Contents/MacOS/Dock" password "adminpass" with administrator privileges

do shell script "open /System/Library/CoreServices/Dock.app.DISABLED"

delay 4

do shell script "chmod -x /System/Library/CoreServices/Dock.app.DISABLED/Contents/MacOS/Dock" password "adminpass" with administrator privileges

do shell script "/usr/bin/quitdock"





In the last line I originally put:

Code:


do shell script "killall "Dock""





But the double quotes didn't work.



Any help? Maybe a way to define the process number and then do a "kill process_number"?



Thanks,



Dale Mox

Comments

  • Reply 1 of 2
    thuh freakthuh freak Posts: 2,664member
    the extra quotes aren't necessary for killall.

    Code:


    do shell script "/usr/bin/killall Dock"







    but, i suggest you throw everything into one shell script, then execute that.



    Code:


    #!/bin/sh

    /bin/chmod +x /System/Library/CoreServices/Dock.app.DISABLED/Contents/MacOS/Dock;

    /usr/bin/open /System/Library/CoreServices/Dock.app.DISABLED;

    /bin/sleep 4;

    /bin/chmod -x /System/Library/CoreServices/Dock.app.DISABLED/Contents/MacOS/Dock;

    /usr/bin/killall Dock;



  • Reply 2 of 2
    Quote:

    Originally posted by thuh Freak

    the extra quotes aren't necessary for killall.

    Code:


    do shell script "/usr/bin/killall Dock"







    but, i suggest you throw everything into one shell script, then execute that.



    Code:


    #!/bin/sh

    /bin/chmod +x /System/Library/CoreServices/Dock.app.DISABLED/Contents/MacOS/Dock;

    /usr/bin/open /System/Library/CoreServices/Dock.app.DISABLED;

    /bin/sleep 4;

    /bin/chmod -x /System/Library/CoreServices/Dock.app.DISABLED/Contents/MacOS/Dock;

    /usr/bin/killall Dock;







    Thanks,



    The point is I want to make this an App that people can easily run to make a hack of mine work well.



    Dale Mox
Sign In or Register to comment.