About some of the previous sentences here - you can use the open command combined with the a flag to open a file with a specific application:
open -a [appname] [filename]
but if [filename] does not exist, it displays the error the file doesn't exists or something like that and does not create the required file, as you requested.
Write the following into your ~/.bashrc (if this file does not exist, you can create it by writing touch ~/.bashrc inside the terminal):
open2() { touch $2 open -a $1 $2 }
And use it as follows:
open2 [appname] [filename]
Please note that appname is the application in your installed application folder ( /Applications ).
The touch command creates the necessary file (do not worry if the file exists, it will not delete / reset the current file, it will only override the modification time to the current time).
Roy Miloh Sep 21 '13 at 22:12 2013-09-21 22:12
source share