Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Jolly Roger Newsgroups: comp.sys.mac.system Subject: Re: photolibraryd Date: 17 Aug 2019 17:00:31 GMT Organization: People for the Ethical Treatment of Pirates Lines: 68 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net 5kl6+7JQBIE8Ps9CAiItUwApgipm/ewju62xdMJfnJp3pkjzwd Cancel-Lock: sha1:FVChydfLSSnwAVX2ieDejonuyOM= X-No-Archive: Yes MMail-Copies-To: nobody X-Face: _.g>n!a$f3/H3jA]>9pN55*5<`}Tud57>1Y%b|b-Y~()~\t,LZ3e up1/bO{=-) User-Agent: slrn/1.0.1 (Darwin) Xref: csiph.com comp.sys.mac.system:125808 On 2019-08-17, Király wrote: > Jolly Roger 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