Can'T Execute Terminal Scripts by Double-Click (Mouse/Trackpad)

Joined
Mar 19, 2017
Messages
3
Reaction score
0
Points
1
(the title is self explanatory - found nothing that solved this - I'm not a newb so the "regular" solutions don't work that's why a new thread)


PS - ...Terminal app DOES INDEED execute (Slthough without opening any window) when double-clicking an already executable shortcut (or thescript itself - so it i not a problem with shortcuts) - but the "script" itself doesn't and since it is already configured to be executable doesn't even show it's path when terminal window opens as it would in other situations!

PS2 - (of course) when exectuing normaly (prompt$ ./executable_script ) it works as always did - it only a double-click with trackpad/mouse problem


.......Double clicking on the dock shortcut for these scripts I've made WAS INDEED Always OK and working perfecly
.....I use them so often that I will consider formatting the system if I can't make them work since it's really not praticle (fast) to exectute them "normaly" in terminal without being able to double-click!
 
Last edited:

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,762
Reaction score
2,100
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
I'm on macOS Sierra 10.12.3

My script
Code:
#!/usr/bin/env bash


echo "Hello there!"

The following pictures how my settings in Get Info, permissions of the file in the terminal and the output of me double-clicking on it in Finder.

Screen Shot 2017-03-20 at 11.51.40 AM.png

Screen Shot 2017-03-20 at 11.52.28 AM.png

Screen Shot 2017-03-20 at 11.54.32 AM.png
 
OP
M
Joined
Mar 19, 2017
Messages
3
Reaction score
0
Points
1
no... exactly as you - not working though..

also tried (never needed it before, but to be sure) to use file extentions *.sh and also *.command and just to be sure it wouldn't be permission prolems to chmod to 777 (-rwxrwxrwx) as well


PS - Even scripts without extended atributtes happens the same so it's not those as well if you may thought it could be it)
 
Last edited:

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,762
Reaction score
2,100
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
What does happen when you double-click on the scripts?
 
OP
M
Joined
Mar 19, 2017
Messages
3
Reaction score
0
Points
1
----if Terminal Application was close it does indeed start Terminal BUT no windows even opens!

..... if Terminal Application is already running it makes an open Terminal window be the active foregroung window and nothing else happens (not even the path shows at the prompt as it usually does)





(did this help? - I just now remembered to check out the console maybe something shoes up... (duh.. didn't remember...)... if it didn't help out I'll check it and post as soon as I may)
 
Joined
Dec 11, 2010
Messages
1,808
Reaction score
40
Points
48
Location
Chicago
Your Mac's Specs
late 2012 mini w/SSD
...Terminal app DOES INDEED execute (Slthough without opening any window) when double-clicking an already executable shortcut (or thescript itself - so it i not a problem with shortcuts) - but the "script" itself doesn't

The "already executable shortcut" is what interests me. Is it possible you forgot how you made that? I think it's likely an automator applet.
https://arstechnica.com/apple/2011/...-services-with-automator-and-shell-scripting/
https://developer.apple.com/library...atorConcepts/Articles/ShellScriptActions.html
 
Joined
Dec 11, 2010
Messages
1,808
Reaction score
40
Points
48
Location
Chicago
Your Mac's Specs
late 2012 mini w/SSD
Or, try this:
add .command in place of .sh in the file name.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top