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.
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/
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 "Calculator.app"
successfully runs /Applications/Calculator, and
openwithterminal "Utilities/Activity Monitor.app"
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 Monitor.app” 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.
This is how the statement goes about building the path.
let apppath = parameter(1)
if apppath notmatch "/"+"*"
apppath = "/"+arrayrange(info("applicationsfolder"),-2,-1,"/")+apppath
endif
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.
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. I will leave the other apps not working for another day and another user.
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/Messages.app
-bash: /System/Applications/Messages.app: 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 Message.app in my Applications folder, the Path at the bottom of the Finder window states that it is at
Robert 16 HD/Applications/Messages.app
but if I drag it from the Finder window to the Terminal window it states
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).