Comment on page
Cheat Sheet
MacOS tips and tricks.
sudo spctl --master-disable
codesign --force --deep --sign - /Applications/AppName.app
Hold down the full-screen button
in the upper-left corner of a window.

Press
Command + space bar
to launch Spotlight. Run automator
.Create a New Document type Quick Action.
Setup the new Action as follows.

Save the as as Open iTerm2.
Open and change the keyboard shortcut config as follows (you can change the shortcut key combination).

Automate printscreen with no screen border or shadow.
Create the following script anywhere in you computer.
#!/usr/bin/osascript
tell application "iTerm" to activate
tell application "System Events"
keystroke "$" using {command down, shift down}
delay 1
key code 49 -- space bar
delay 1
key down {option}
display notification "Printscreen is ready" with title "Custom printscreen READY" subtitle "Capture window" sound name "Frog"
delay 5
key up {option}
display notification "Printscreen finished" with title "Custom printscreen FINISHED" subtitle "Capture window" sound name "Frog"
delay 1
key up {option}
end tell
Save it and make sure to
chmod +rx
it.Press
Command + space bar
to launch Spotlight. Run automator
.Create a New Document type Quick Action.
Setup the new Action as follows.

Save it as "Custom snap".
Make sure to "Run" it before creating a keyboard shortcut because it requires some MacOS "allow" actions.
To create a keyboard shortcut go to Settings -> Keyboard as follows.

#!/usr/bin/osascript
tell application "Safari"
set docText to ""
set windowCount to count (every window where visible is true)
repeat with x from 1 to windowCount
set tabCount to number of tabs in window x
repeat with y from 1 to tabCount
set tabName to name of tab y of window x
set tabURL to URL of tab y of window x as string
set docText to docText & tabName & " – " & tabURL & linefeed as string
end repeat
set the clipboard to the docText
end repeat
end tell
defaults write com.apple.screencapture location /new/path/for/screenshots
Install bash-completion:
brew install bash-completion
Install docker-compse auto complete:
sudo curl -L https://raw.githubusercontent.com/docker/compose/1.24.0/contrib/completion/bash/docker-compose -o /usr/local/etc/bash_completion.d/docker-compose
sudo chmod +x /usr/local/etc/bash_completion.d/docker-compose
Create symbolic links:
cd /usr/local/etc/bash_completion.d
ln -s /Applications/Docker.app/Contents/Resources/etc/docker.bash-completion
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-machine.bash-completion
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.bash-completion
Edit bash_profile:
vi ~/.bash_profile
Add the following content:
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
Open a new terminal and test.
Activate the app, to bring it to the front
osascript -e "tell application \"iTerm\" to activate"
User other app names such as Chrome.
Bounds is startX, startY, endX, endY.
osascript -e "tell application \"iTerm\" to set the bounds of the first window to {0, 0, 1920, 1080}"
User other app names such as Chrome.
Last modified 2yr ago