Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
start_komodo_from_command_line_on_mac [2014/05/15 14:33]
Joel Dare
start_komodo_from_command_line_on_mac [2020/06/01 22:53] (current)
Line 1: Line 1:
 +====== Start Komodo Edit from Command Line on Mac ======
 +
 +There are two ways to get Komodo to open files from the command line on the Mac. The first is to create an alias for the command '​komodo'​ that launches Komodo with any file you specify. That's how I did it when I first wrote this article, but there'​s another and probably better way.
 +
 +===== The Open Command =====
 +
 +The Mac has a command line utility called //open//. The //open// command will open any app, folder, or file in it's associated application. If double clicking on //.php// files already opens them with Komodo then running something like //open myfile.php//​ will do the same thing. No shortcuts or aliases needed and you can use this trick to open any file that you would typically double-click in Finder.
 +
 +  open myfile.php
 +
 +If you don't already have //.php// files associated with Komodo you can right click on a //.php// file in Finder and select //Get Info//. Then, find the //Open with// section, set the drop-down to //Komodo Edit 8// and click the //Change All// button to make all //.php// files open with Komodo. Now the //open// command will do the same.
 +
 +===== Komodo Alias =====
 +
 +If you still want to go ahead with creating a shortcut specifically to launch Komodo Edit on the command line, you can run the following command.
 +
 +  alias komodo='​open -a "​Komodo Edit 8"'​
 +
 +Notice that it used that magical //open// command we just talked about. It creates an alias to open the Komodo app though.
 +
 +The best option is to add that line to your ~/.profile file so that it runs every time you open a terminal. I use Vi to edit that file and then past that line into it.
 +
 +  vi ~/.profile
 +
 +Now you can start Komodo Edit from the command line either by entering //komodo// or by entering that followed by a filename you want to open.
 +
 +  komodo some_file.txt
 +
  
comments powered by Disqus