Open specific folders in NC via shell command?

Questions, glitches, bugs and crashes
Locked
JayB
Posts: 192
Joined: Sun Jan 08, 2017 4:38 pm

Open specific folders in NC via shell command?

Post by JayB » Tue Jan 10, 2017 12:46 pm

I'm trying to open specific directories in NC from the shell (and eventually from shell scripts), but when I use e.g.

Code: Select all

open -a "Nimble Commander" $HOME/GitHub
NC only navigates to $HOME and sets the active cursor on the directory ./GitHub, instead of actually opening the latter. Is there a way to do it? If you do it with

Code: Select all

open -a "Nimble Commander" $HOME/GitHub/*
NC will indeed open the $HOME/GitHub, but it will select all files/dirs within it, which is not the intended behavior.

EDIT: Using

Code: Select all

cd $HOME/GitHub && open -a "Nimble Commander" .
doesn't work either.

EDIT2: you could add the --args option to pass further commands to NC, but NC doesn't seem to respond. (?)

User avatar
mike
Posts: 1060
Joined: Thu Jul 16, 2015 5:35 am
Location: Exeter, UK

Re: Open specific folders in NC via shell command?

Post by mike » Mon Jan 16, 2017 3:53 am

JayB,

I've spent some time investigating what's going on here.
The outcome this that no matter in what form you specify a path, i.e. "$HOME/GitHub" or "$HOME/GitHub/", OSX will regardlessly pass it as ".../GitHub" into NC, so there's no way to distinguish these requests on my side. Looks like "open" command does some parameters processing itself.
I know that that opening in Finder (without -a key) makes the difference between these forms, but have no knowledge of how to force it pass this trailing slash into NC.

So, leaving this issue opened for now.

Oh, about additional arguments, I actually never dug into that interfaces, but with my current knowledge - arguments passing system is very-very crippled in UI applications on OSX.

Locked