OpenWithTerminal has problems with some apps

OpenWithTerminal can open some apps, and not others.

When it fails, Panorama states
“Cannot open with Terminal, «ApplicationName».app is missing or corrupted.”

I have not had success opening Calculator, Messages, Home, Activity Monitor, PanoramaX.Server"

I have had success opening Keynote, News, Network Utility.

So some in the Applications folder work, some do not.

While Network Utility in the System folder path did work, PanoramaX.Server in my Library folder path did not. And of course the PanoramaX.Server was the one I was most anxious for.

Can others confirm?

This is what I get for the server.

I just opened the PanoramaX server app with OpenWithTerminal:

openwithterminal "/Users/garyyonaites/Library/Application Support/PanoramaX/Server/PanoramaX"

I found the app in the Finder and then just dragged the file to my procedure and quoted the dragged path & file name. Worked just fine on my 10.13.6 system/

That’s also how I wrote my path. Same OS as Gary.

It seems you need the full subpath of the application package (i.e. allowing for the fact that some applications are in subdirectories within /Applications).

For me,

openwithterminal ""

successfully runs /Applications/Calculator, and

openwithterminal "Utilities/Activity"

successfully runs /Applications/Utilities/Activity Monitor (or rather, in each of those cases, the executable within the package).

If you can’t run Calculator, Messages, etc., are they in subdirectories of /Applications in your case?

If you include the full path of PanoramaX.Server in the openwithterminal command, does that work?

As I noted, several apps that sit in the Applicatons folder did not work, while others sitting in the Applications folder did work. Regardless, the docs state that any app in the Appllications folder does not need full pathing. I did not use full path to items in the Applications folder but yet some did work and some did not work.

I did use full pathing for all other testing of apps that were not in the Applications. As noted, the /System path for Network Utilities did work but the /Users path to PanoramaX.Server did not.

What might be helpful in tracking this down is if others could try the other apps I mentioned as they are all standard install with Apple’s OS. Consistency or lack thereof could helpl explain this.

I also find it interesting that PCNewbie was able to sucessfully run with “Utilities/Acitivity” as that is not the entire path which is what the Help pages state is necessary. The Help pages state specifically that to run that app, it should have required “/Applications/Utilities/Activity Monitor”

PCNewbie, can you confirm what you said that the Activity Monitor app in a subfolder of the Applications folder actually did not need a full path? I can imagine that it could be found as it is in a subfolder, but both Gary & I & the Help docs say it should not have worked.

That was the case for me as well. Just using “Utilities/Acitivity” resulted in a error.

That worked for me.

This is how the statement goes about building the path.

let apppath = parameter(1)

if apppath notmatch "/"+"*"
    apppath = "/"+arrayrange(info("applicationsfolder"),-2,-1,"/")+apppath

If you begin it with a /, it assumes you have already written the complete path. If it doesn’t begin with a /, it writes the path to the Applications folder, and tacks what you have written on to the end.

I kept trying the two variations with a constant error on the shorter version but at some point they both started to work. I too checked the code of the openwithterminal procedure and also see that they should both be executing the same applescript do script upon execution. I have no idea why one was not working initially through several attempts.

It depends how you spell ‘Ac(i)tivity’.

And I tested all of the apps mentioned earlier on a different Mac with a different OS and continue to get the same errors on every app but PanoramaX Server. I did get that going as that one did have a typo in the name. :frowning: I will leave the other apps not working for another day and another user.

This is why it is dangerous to simply cut and paste. :flushed:

Ok. Interesting here. I did the preached Drag & Drop from my Messages app icon in the Finder to the Terminal window and got an error which could be why the OpenWithTerminal is not able to do it as well.

Robert-16-MacBook-Pro:~ rameeti$ /System/Applications/

-bash: /System/Applications/ is a directory

Why would the system recognize the Messages app a directory when dragged from the Finder. Aren’t I hearing that that is ‘right way’ to do this?

If I click on the in my Applications folder, the Path at the bottom of the Finder window states that it is at

Robert 16 HD/Applications/

but if I drag it from the Finder window to the Terminal window it states

Robert-16-MacBook-Pro:~ rameeti$ /System/Applications/ 

so Apple is doing some alias stuff here as there are in fact real apps sitting in the /System/Applications/ directory and the alias’s that are sitting in /Applications/ folder are assisting in confusion of finding it. Regardless of these differences, I could not get it to do anything but say that Messages was missing or corrupt (the same as several other apps).