0

open isn't behaving as expected on Mojave. Running

open /Library/

gives

LSOpenURLsWithRole() failed with error -600 for the file /Library.

This happens regardless of the opening location. I'm totally lost here. Any hints?

Edit:

It is working now after letting my laptop go to sleep for a while, for whatever reason. If you run into this issue, I guess just try a reboot.

3
  • I'm no Terminal guru, but open == launch/execute. You can't launch a folder, it doesn't have execute perms, which is what the LSOpenURLsWithRole() error actually means. Someone will come along with the command you actually need, I don't know that, sorry.
    – Tetsujin
    Commented May 7, 2020 at 16:15
  • open -a Finder.app /Library. though open /Library too works for me.
    – anki
    Commented May 7, 2020 at 17:47
  • 1
    @Tetsujin This is not true, open used in the way I describe opens Finder at that location, and does work in general Commented May 7, 2020 at 20:50

2 Answers 2

2

Not able to reproduce the error as I have access to Catalina's and High Sierra's macs but not Mojave. But you may want to try if updating permissions for your Terminal.app and iTerm.app resolved the issue:

System Preferences> Security&Privacy> Privacy> add both apps to "Accessibility" and "Automation" lists

Deleting & re-adding them could also help (it worked for me a few weeks back, re-enabling osascript assistive access to the system UI for my terminal scripts that had suddenly stopped working).

Nota & Disclaimer: control panel headings above are Catalina's - High Sierra has only "Accessibility" - Mojave's should be close enough though -- Obviously changing any such Security settings is done at your own risks etc... -- while I did not have to do it in my case, logoff/logon could help ensure the permissions are properly applied.

0

It should be doable and you have the right general idea but what you need to do instead is add the " -R " flag:

open -R /Library

If you type just "open" at a command prompt you'll get the options.

1
  • This is not necessary; open ., for example, will open the current directory in Finder, no R flag needed. It is suddenly working for me now after letting my laptop go to sleep, for whatever reason. Commented May 7, 2020 at 20:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .