Unix question

Posted:
in macOS edited January 2014
When in the command line, say...



$ open picture.jpg



...gets opened by preview right, but what if I wanted photoshop to open it? How do I specify which app to open something?



Damn newbie unix questions!!!!



Thanks.

Comments

  • Reply 1 of 3
    jbljbl Posts: 555member
    Check out the man page for open (e.g., type "man open" into the terminal).

    It says you can use the form

    open -a applicationName fileName

    For example, I just tried:

    open -a "Adobe Photoshop CS" IMG_0163.JPG

    Seemed to work as expected.
  • Reply 2 of 3
    idunnoidunno Posts: 645member
    Ahh, good point. Thanks.
  • Reply 3 of 3
    lundylundy Posts: 4,466member
    Quote:

    Originally posted by iDunno

    When in the command line, say...



    $ open picture.jpg



    ...gets opened by preview right, but what if I wanted photoshop to open it? How do I specify which app to open something?



    Damn newbie unix questions!!!!



    Thanks.




    The BSD open command uses the LaunchServices setting for the file. Change the Open With... setting in the Get Info for the file.
Sign In or Register to comment.