|
|
Start and stop Apache from the dock
Kewl hint, but what I find easier for starting Apache is SharingMenu. it should be available at macupdate or VT.
Start and stop Apache from the dock
olwylee was faster...
Start and stop Apache from the dock
The nice thing about this hint is the help one gets in making these kinds of simple script programs for OS X, using a real life example. A program that does it for you is mostly beside the point.
Start and stop Apache from the dock
Save this as a stay-open application. When launched, it should run the script provided by the original poster. On subsequent clicks of the script's Dock icon, it will run the script again, without the need to go through the entire launch lag. I haven't tested the code but it should be close to what you want.
on run
my toggle -- remove this if you don't want it to execute the code on launch.
end run
on reopen
my toggle
end reopen
on toggle()
do shell script "sudo /usr/sbin/apachectl stop"
if result = "/usr/sbin/apachectl stop: httpd (no pid file) ¬
not running" then
do shell script "sudo /usr/sbin/apachectl start"
display dialog "Apache Started" with icon 2 buttons ¬
{"OK"} giving up after 1
else
display dialog "Apache Stopped" with icon 2 buttons ¬
{"OK"} giving up after 1
end if
tell application "System Events" to ¬
set visible of first application process whose frontmost is true to false
end toggle |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.13 seconds |
|