With the URL <file:///Library/Fonts> (for example in a note in NV) I can open the finder with the given location. Can I do something similar for the terminal? That is, if I write for example (doesn't work, that is the question!) <terminal://Library/Fonts> the Terminal.app should open a new window and cd to that directory.
|
|
|||
| show 1 more comment |
|
This works from the command line:
Where /Users/ is the directory you want to set the working directory to. |
|||||
|
Opening a New Terminal InteractivelyAs of Mac OS X Lion 10.7, Terminal has a “New Terminal at Folder” Service you can enable in: System Preferences > Keyboard > Services > Files and Folders With this Service you can open a new terminal by selecting a folder or file path in any application and choosing this Service in the contextual menu (Control-Click or Right-Click) or the Services submenu in the application menu. It doesn’t support “file:” URLs, but you can select the path part of the URL “/Library/Fonts” and use the Service with that. There is also a “New Terminal Tab at Folder” Service. Opening a New Terminal ProgrammaticallyIf you need to open it from a command line or shell script, you can use the
(This is equivalent to dragging a folder, file path or “file:” URL onto the Terminal application, which opens a new Terminal at that location.) |
||||
|
|
|
Try the
Run |
||||
|
|
opencommand line:open file:///foo/baror (as I wish)open terminal://Library/Fonts– topskip Jul 21 '12 at 19:34