Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: hide dock #8

Open
gokaygurcan opened this issue Dec 1, 2017 · 1 comment
Open

Feature: hide dock #8

gokaygurcan opened this issue Dec 1, 2017 · 1 comment

Comments

@gokaygurcan
Copy link
Contributor

Hi,
This is easy thing to do, but there're two questions:

  • what will happen if the dock is already hidden?
  • what will happen to the window if it's on the screen? (fullscreen or not for example)

Simplest way that I can think of

tell application "System Events"
  keystroke "d" using {command down, option down}
end tell
@boettges
Copy link

boettges commented Jun 11, 2018

set dockplistpath to "~/Library/Preferences/com.apple.dock.plist"

tell application "System Events"
	tell property list file dockplistpath
		tell contents
			set dockishidden to value of property list item "autohide"
		end tell
	end tell
end tell

if dockishidden then
else
	tell application "System Events"
		tell dock preferences to set autohide to not autohide
	end tell
end if

This skript will read the current state of the user's dock settings for the "autohide" setting first and only toggle via simulating the keystroke if it is visible. 👌

@zehfernandes zehfernandes changed the title feature: hide dock Feature: hide dock Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants