You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

How do I create executable commands on MacBook Air?

How to make executable commands! I need that.

chmod 755 ~/Desktop/Cmd.tool

I know ↑ but I want to make like that ↓.


[Re-Titled by Moderator]

MacBook Air 13″, 12.7

Posted on Nov 8, 2024 10:24 AM

Reply
4 replies

Nov 9, 2024 4:41 AM in response to LoadingError

Shell scripts can be made executable but they are not compiled by a compiler, thus they will not have the Apple exec icon, but rather a white icon with text on it when viewed from the Finder. This is also true for the foo.command named files as seen by the Finder that contain Shell commands and can be run from the Finder with a double click.


In practice, I use the following filename extensions for scripts or language files. There is no .tool recognized by macOS:

  • Zsh (.zsh)
  • Bash (.sh)
  • Ksh (.ksh)
  • Python (.py)
  • Ruby (.rb)
  • Perl (.pl)
  • Awk (.awk)
  • Swift (.swift)
  • Objective-C (.m)
  • C (.c)
  • C++ (.cpp, .C)
  • AppleScript (.applescript)
  • JavaScript (.js)
  • JavaScript for Automation (.js, .jxa)

Nov 15, 2024 2:18 PM in response to VikingOSX

VikingOSX wrote:

• Shell scripts can be made executable but they are not compiled by a compiler, thus they will not have the Apple exec icon, but rather a white icon with text on it when viewed from the Finder. This is also true for the foo.command named files as seen by the Finder that contain Shell commands and can be run from the Finder with a double click.

FYI, my shell scripts do have the "exec" icon on them if the Terminal is associated with opening them although by default I think the GUI app used to create/edit the scripts will be applied...and reapplied again. I wanted my shell scripts to be able to be launched by double-clicking on them to make things easier for my co-workers who are not as comfortable with the command line (I think I also had to remove the file extensions to allow this as well).




How do I create executable commands on MacBook Air?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.