Run a plist with Terminal command

Hi all.

This probably isn’t the best place to ask this question, so if there is no help here, I’m not offended.

I want to run a plist file to start an old screensaver manually.

Looking via Google I haven’t found anything that tells me how to do this. There are how to CREATE a plist, but not a way to run them from a command line.

Has anyone done this?

If so how?

And if anyone knows where there is a list of actions that go in the key section, that would be helpful too.

Regards

Plist files are property lists, they don’t “run”. I suspect you need to investigate how to manually start an old screensaver and then apply that technique to whatever file you have. I don’t expect you will find anything searching for how to “run a plist”.

Hi Tim.

I understand (to a point… I’m self taught as a programmer) what you are saying but I have a situation, and maybe YOU can explain it where I go:

var disableTheCurrentScreensaver as New Shell
disableTheCurrentScreensaver.Execute ("defaults -currentHost write com.apple.screensaver idleTime 0”)

it stops the set screensave from launching (according to what I read from apple).

However when my program ENDS, I run this:

var resetTheScreensaverTime as New Shell
resetTheScreensaverTime.Execute ("defaults -currentHost write com.apple.screensaver idleTime 3600”)

and when I go into system settings, the entry still shows as NEVER.

And, yes, it is one of the options available. I read that if you chose something like 7 minutes because it wasn’t an apple time setting it wouldn’t work.

So I am wondering if I have to relaunch the com.apple.screensaver to make the restart work.

Regards.

Look into Launch Services. It controls the automatic/timed/etc launching of processes on the Mac.

When you edit a plist it’s not necessary to relaunch the application or whatever you mean with relaunching a plist. Do you have this plist by default because I can’t find it with PrefsEditor:

Hi Beatrix. Yes I do.

But I did find out something … interesting.

When I run my program, and do, via terminal, the command

defaults -currentHost read com.apple.screensaver

I see the idle time change. And when my program quits, and I do the same command, it is just showing the right setting.

Just System Settings entry is still showing the NEVER entry.

Go fig.

Regards

Are you in the correct host? I think every developer has mixed up the hosts at least once. I remember feeling utterly stupid as the values didn’t change.

Hi Beatrix.

I use

-currentHost

which by my understanding (and it could be wrong) is who I am logged in as. And I am an Administrator.

Now, I did notice that there are two idleTimes.

idleTime
and
idletime

and no, I’m not being funny.

defaults -currentHost read com.apple.screensaver
{
CleanExit = 1;
PrefsVersion = 100;
idleTime = 3600;
idletime = 3600;
moduleDict = {
moduleName = iLifeSlideshows;
path = “/System/Library/ExtensionKit/Extensions/iLifeSlideshows.appex”;
type = 0;
};
tokenRemovalAction = 0;

Right now, when I run my program, and actually run the command on both of them, everything seems to be changing properly.

Oh, and I was doing some reading and I might have to do a

killall cfprefsd

Stay tuned.

What macOS are you on ? In Sonoma (madOS 14) and later, Apple changed the Screen Saver preferences / plist system yet again.

See https://forum.iscreensaver.com/t/understanding-the-macos-sonoma-screensaver-plist

Maybe helps pmset and or caffeinate.

Thanks. I’ll take a look.

Regards