Created
May 27, 2014 11:24
-
-
Save viktorklang/9ce330286de107709131 to your computer and use it in GitHub Desktop.
AppleScript to toggle the use of Dock.app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
MIT License | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
*) | |
on run {input, parameters} | |
set inactivePath to "/System/Library/CoreServices/Dock.app.bak" | |
set activePath to "/System/Library/CoreServices/Dock.app" | |
if application "Dock" is running then | |
do shell script "mv " & activePath & " " & inactivePath & "; killall Dock" with administrator privileges | |
else | |
do shell script "mv " & inactivePath & " " & activePath & "; open " & activePath with administrator privileges | |
end if | |
return input | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment