Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.mac.system > #125808

Re: photolibraryd

From Jolly Roger <jollyroger@pobox.com>
Newsgroups comp.sys.mac.system
Subject Re: photolibraryd
Date 2019-08-17 17:00 +0000
Organization People for the Ethical Treatment of Pirates
Message-ID <grqq5eFoonbU1@mid.individual.net> (permalink)
References <qj6kqu$ov0$1@dont-email.me> <gro4l0F75egU1@mid.individual.net> <qj80nf$klh$1@dont-email.me>

Show all headers | View raw


On 2019-08-17, Király <me@home.spamsucks.ca> wrote:
> Jolly Roger <jollyroger@pobox.com> wrote:
>>
>> It's possible that behavior is due to a bug. It's also possible that
>> Apple hasn't considered this use case (two users sharing the same
>> library on a volume whose ownership & permissions are ignored.
>> 
>> Seems like a great candidate for a bug report.
>
> Yeah, but I doubt Apple will fix this for me. I'm using a 10 year old
> iMac, so stuck on High Sierra. Was hoping for a homemade solution,
> like some way to automate the force quitting of photolibraryd when the
> Photos app is quit.

That's easy to do with most scripting languages, including AppleScript.
Put this code into a new Script Editor window and save it as Format:
Application with the Stay open after run handler option enabled. Then
you can run it at login by adding it to your System Preferences > Users
& Groups > Login Items panel:

-- begin script
property waiting : false

on run
	set waiting to false
end run

on idle
	if waiting then
		if not AppIsRunning("Photos") then
			set pid to ProcessIsRunning("photolibraryd")
			if pid is not "" then
				set killResults to do shell script ("kill -9 " & pid as text)
				if killResults is not "" then
					tell application "System Events" to display alert "Potential Error" message ("Kill command returned unexpected results: " & return & return & killResults as text) buttons {"Thanks"} default button 1
				end if
			end if
		end if
	else
		if AppIsRunning("Photos") then
			set waiting to true
		end if
	end if

	return 1
end idle

on AppIsRunning(appName)
	tell application "System Events"
		set isRunning to (appName is in (name of every process))
	end tell
	return isRunning
end AppIsRunning

on ProcessIsRunning(processName)
	set pid to ""
	try
		set pid to do shell script ("pgrep " & processName as text)
	end try
	return pid
end ProcessIsRunning
-- end script

-- 
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

Back to comp.sys.mac.system | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

photolibraryd me@home.spamsucks.ca (Király) - 2019-08-16 16:15 +0000
  Re: photolibraryd ~BD~ <dgb@nomail.invalid> - 2019-08-16 17:25 +0100
  Re: photolibraryd Jolly Roger <jollyroger@pobox.com> - 2019-08-16 16:41 +0000
    Re: photolibraryd me@home.spamsucks.ca (Király) - 2019-08-17 04:44 +0000
      Re: photolibraryd gtr <xxx@yyy.zzz> - 2019-08-16 22:49 -0700
      Re: photolibraryd Jolly Roger <jollyroger@pobox.com> - 2019-08-17 17:00 +0000
        Re: photolibraryd me@home.spamsucks.ca (Király) - 2019-08-17 22:29 +0000
          Re: photolibraryd Jolly Roger <jollyroger@pobox.com> - 2019-08-18 22:40 +0000
            Re: photolibraryd me@home.spamsucks.ca (Király) - 2019-08-22 15:34 +0000
              Re: photolibraryd Jolly Roger <jollyroger@pobox.com> - 2019-08-22 15:52 +0000
                Re: photolibraryd gtr <xxx@yyy.zzz> - 2019-08-22 21:49 -0700
                Re: photolibraryd Jolly Roger <jollyroger@pobox.com> - 2019-08-23 18:31 +0000
                Re: photolibraryd gtr <xxx@yyy.zzz> - 2019-08-23 17:39 -0700
                Re: photolibraryd Jolly Roger <jollyroger@pobox.com> - 2019-08-24 19:27 +0000
                Re: photolibraryd me@home.spamsucks.ca (Király) - 2019-08-26 15:41 +0000
                Re: photolibraryd Jolly Roger <jollyroger@pobox.com> - 2019-08-27 23:09 +0000

csiph-web