I have an art collection of 8000 pics, I have them divided into folders of about 200 each. I'm going to use python to randomly select one of these folders so that my screensaver will continually show me the work of a new artist rather than randomly mixing all the artists together. To do this I need to change the folder that the screensaver uses with Python which will then change the folder using Terminal.
I read this article and it seems that you can do that by using this command:
https://krypted.com/mac-security/mac-setting-screen-saver-from-the-cli/
defaults -currentHost write com.apple.screensaver modulePath -string "/users/kylefoley/pictures/art/art 2/impressionism/claude monet/"
But that didn't work. Also, I am using macos 10.14
UPDATE
When I input: /usr/bin/defaults -currentHost read com.apple.ScreenSaverPhotoChooser
I get the expected result, viz, the actual folder that the screensaver is using. When I input: /usr/bin/defaults -currentHost write com.apple.ScreenSaverPhotoChooser SelectedFolderPath -string "/users/kylefoley/pictures/art/art 2/impressionism/claude monet/"
then input /usr/bin/defaults -currentHost read com.apple.ScreenSaverPhotoChooser
I get
{
CustomFolderDict = {
identifier = "/Users/kylefoley/Pictures/art/complete art 2";
name = "complete art 2";
};
SelectedFolderPath = "/users/kylefoley/pictures/art/art 2/impressionism/claude monet/";
SelectedSource = 4;
ShufflesPhotos = 1;
}
Which is wrong because the path for the CustomFolderDict['identifier'] should be the same as the SelectedFolderPath
I then made a guess and tried:
/usr/bin/defaults -currentHost write com.apple.ScreenSaverPhotoChooser CustomFolderDict -identifier "/users/kylefoley/pictures/art/art 2/impressionism/claude monet/"
which outputted Unexpected argument
. If think I could figure out how to fix that CustomFolderDict with command line then that might solve the problem.
UPDATE 2
I inputted:
/usr/bin/defaults -currentHost write com.apple.ScreenSaverPhotoChooser CustomFolderDict -dict-add identifier "/users/kylefoley/pictures/art/art 2/impressionism/claude monet/"
/usr/bin/defaults -currentHost write com.apple.ScreenSaverPhotoChooser CustomFolderDict -dict-add name "claude monet"
And although I get
{
CustomFolderDict = {
identifier = "/users/kylefoley/pictures/art/art 2/impressionism/claude monet/";
name = "claude monet";
};
LastViewedPhotoPath = "";
SelectedFolderPath = "/users/kylefoley/pictures/art/art 2/impressionism/claude monet/";
SelectedSource = 3;
ShufflesPhotos = 1;
}
When I input
/usr/bin/defaults -currentHost read com.apple.ScreenSaverPhotoChooser
The new result is just a blank screen with the name of my computer on it.