Setting the default directory where screenshots are saved - macos

I am writing a utility that changes the directory where the Mac OS X saves the screenshots taken when pressing the shortcuts listen in the Keyboard preference panel. Where should that value be saved, to be used from the Mac?

In ~/Library/Preferences/com.apple.screencapture.plist under the key location. Source: http://hints.macworld.com/article.php?story=20050824073301844

Related

What is the terminal command line in OSX Mojave to find the folder where screenshots are saved?

What Terminal command in OSX will show the path where screenshots are set to save? I am trying to find a screenshot I took last week on my Macbook Pro running OSX Mojave. There are no screenshots saved on my desktop which I understand to be the default save location. Therefore I am thinking I changed the save location but don't remember where.
I already tried searching for 'Screenshots' in Finder but this only shows screenshots taken before Oct 2018 even though I have taken many since then, including in the last hour. Same for the 'Screenshots' folder in my Dropbox.
I also verified that the screenshot shortcut I used Command+Shift+4 is correctly set to 'Save picture of selected area a file' and 'Copy picture of selected area to the clipboard'. I verified this in System Preferences > Keyboard > Shortcuts > ScreenShot. And successfully took a screenshot with this shortcut just now.
This works for me on macOS Mojave 10.14.3:
defaults read com.apple.screencapture location
Sample Output
~/Desktop

How to change the icon of Terminal default on Mac OS

How can I change the icon on the Terminal app on Mac OS?
I can change the icon on other apps but I can't change it for the Terminal.
I tried to change the icon for the Terminal app without success.
It requires admin authentication, but I'm using an admin account, can I change it?
You can make a copy of the Terminal app, place that copy inside /Applications. Perform the icon change on that copy and rename the copy to something like "MyTerminal" so that you can tell the difference in Spotlight.

Preferences Error "Could not load Sharing preference pane" El Capitan

Need to use Mac as Xamarin Mac Agent and configure remote login.
Anyone come across this error?
For some reasons, permissions are be changed so you are not able to see some panels. To fix it, you should restart your computer in SafeMode
Safe Mode boot deletes system caches that may help after an OS X upgrade.
Top left corner of your screen click the Apple  > Shut Down.
After your Mac shuts down, wait 10 seconds, then press the power button.
Immediately after you hear the startup tone, hold down the Shift key. You should press the Shift key as soon as possible after you hear the startup tone, but not before.
Release the Shift key when you see the gray Apple logo and progress indicator.
Once you are in Safe Mode, enter the Sharing panel (without changing anything) and then go back to the Apple  menu. From the drop down menu click: Restart.
This should fix the problem. If not, you should try to restore all files permission by using "Repair disk permission" utility. To do this,
open Disk Utility, which is in the Utilities folder of your Applications folder.
Select the startup disk from the list of volumes.
Click the First Aid tab.
To check permissions, click Verify Disk Permissions. To repair permissions, click Repair Disk Permissions.
Disk Utility checks a file's permissions only if the file has a corresponding receipt in /var/db/receipts. The receipt tells Disk Utility what the permissions should be. Not all installers include a receipt with the files they install.
I hope it helps.

Where are OS X Terminal Window Groups saved

I know you can save Window Groups in Terminal using Windows > Save Windows as Group…, as explained in Mac OS X / Open terminal with specified windows.
However, where does Terminal save these states? I switch between an iMac and MacBook and want to sync these settings somehow. I'm thinking I could use a reverse symlink between the settings and Dropbox, but I need to know where they are first.
Window groups are saved in a plist file at ~/Library/Preferences/com.apple.Terminal.plist. You an edit these using the plist file editor that comes with XCode ('open .apple.Terminal.plist' from a shell is sufficient if you've got XCode installed).
Fortunately you don't have a catch-22 when editing this file from a Terminal window. Terminal doesn't automatically checkpoint the file on exit, so you can edit the file, exit Terminal, then restart your Mac in order to refresh the data from the file.

Mac OS X Services: enable without user interaction?

I wrote a simple Mac 'Service' for Finder, that executes a command.
Basically: this adds a ContextMenu in Finder.
If I right-click a file in Finder, a menu item pops up. If the user clicks it, it executes my script. (kind of like 'Send to Bluetooth device, ...')
In OS X Leopard (10.5) and earlier, all services are enabled.
In 10.6 (Snow Leopard), Apple changed the behavior, services now have preferences, and can be enabled or disabled by the user. (which is a good thing)
However, I wrote the service, but there seems to be no way to enable it automatically (in our installer).
I tried doing it with Applescript, going to the System Preferences and ticking the checkbox that way, but it requires some accessibility features to be turned on. (off by default).
Is it possible? If so, how?
Or do I need something else to provide Context Menus in Finder.
I tracked File changes on my filesystem while changing the preferences and discovered there was a plist file:
~/Library/Prefrences/pbs.plist
which contains what I need.
If I edit that manually, it seems to work. So, problem solved :)

Resources