Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@aarondfrancis
Created December 15, 2022 16:15
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aarondfrancis/f0671e537b3ff5f2261b3b854d9cac1d to your computer and use it in GitHub Desktop.
Save aarondfrancis/f0671e537b3ff5f2261b3b854d9cac1d to your computer and use it in GitHub Desktop.
#!/usr/bin/osascript
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Hide Everything
# @raycast.mode silent
# @raycast.packageName Recording
# Optional parameters:
# @raycast.needsConfirmation false
tell application "System Events"
tell dock preferences to set autohide menu bar to true
tell dock preferences to set autohide to true
do shell script "defaults write com.apple.finder CreateDesktop -bool FALSE;killall Finder"
end tell
@gcavanunez
Copy link

Do you essentially plug it to raycast via script commands?

@Israel120
Copy link

yes

@Israel120
Copy link

Israel120 commented Dec 15, 2022 via email

@aarondfrancis
Copy link
Author

@OlivierEstevez
Copy link

Since your code is only for hiding, you can make it toggle with a single script like this:

tell application "System Events"
	tell dock preferences
		if ( (autohide of (get properties)) = true and (autohide menu bar of (get properties)) = true ) then
			set autohide menu bar to false
			set autohide to false
			do shell script "defaults write com.apple.finder CreateDesktop -bool TRUE;killall Finder"
		else
			set autohide menu bar to true
			set autohide to true
			do shell script "defaults write com.apple.finder CreateDesktop -bool FALSE;killall Finder"	
		end if
	end tell
end tell

@aarondfrancis
Copy link
Author

@OlivierEstevez oh, that's smart! good idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment