Ability to reveal file/folder by passing commandline arguments

Any wishes
canab
Posts: 5
Joined: Thu Oct 01, 2015 7:52 am

Ability to reveal file/folder by passing commandline arguments

Post by canab » Fri Oct 30, 2015 9:55 am

Hi,

For reference: TotalCommanter's command line arguments:
http://www.ghisler.ch/wiki/index.php/Co ... parameters

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

Re: Ability to reveal file/folder by passing commandline arguments

Post by mike » Sun Nov 01, 2015 11:39 am

canab wrote:Hi,

For reference: TotalCommanter's command line arguments:
http://www.ghisler.ch/wiki/index.php/Co ... parameters
Hello canab,
This feature looks very interesting from a programmer's perspective :)
However, I'm not sure about use cases in a real life.
In what situations such ability can be useful?
Mike.

canab
Posts: 5
Joined: Thu Oct 01, 2015 7:52 am

Re: Ability to reveal file/folder by passing commandline arguments

Post by canab » Sun Nov 01, 2015 12:03 pm

Hello migun,

Allmost all osx application which operates with files have functionality "Reveal this file/folder in Finder". Feature I requesting is the same in case if I want to replace Finder with Files.

It is just a feature that allows to get to the any place in a most fast way.
For example:
- type part of filename in spotlight/alfred
- choose "reveal in Files"
- I am in Files insite this folder/onthis file!

screencast with this feature (implemented by scripting with applescript):

https://dl.dropboxusercontent.com/u/167 ... -58-45.mp4

P.S.
You are right, most my cases are related with development. But I think most people who need special application for file management somehow related to software development.

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

Re: Ability to reveal file/folder by passing commandline arguments

Post by mike » Sun Nov 01, 2015 12:09 pm

That makes sense.
But I thought that Files already supports "Reveal In..." for maybe last two years.
Am I missing something here?

User avatar
darek
Posts: 179
Joined: Thu Jul 16, 2015 4:50 pm
Location: Warsaw, Poland
Contact:

Re: Ability to reveal file/folder by passing commandline arguments

Post by darek » Mon Nov 02, 2015 10:41 am

migun, wait, so you're saying that for example in Lightroom, there's a way to change that "Show in Finder" option to "Show in Files"?
show-in-finder.png
show-in-finder.png (72.5 KiB) Viewed 14468 times

canab
Posts: 5
Joined: Thu Oct 01, 2015 7:52 am

Re: Ability to reveal file/folder by passing commandline arguments

Post by canab » Mon Nov 02, 2015 10:48 am

Now I can see "Reveal in Files" (not in all places), maybe it was absent because I didn't have installed "Files" from AppStore.
BTW, (IMHO) to have an ability to open file/folder by passing arguments is a powerful concept that allows configure "Files" as a navigation tool in other programs. Especially if implementation of this is trivial.

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

Re: Ability to reveal file/folder by passing commandline arguments

Post by mike » Tue Nov 03, 2015 5:20 am

Well ok, that's an area where I frankly have very small knowledge.
I know that there's a magic "NSFileViewer" defaults value, that may, in theory, substitute Finder in some applications.
Even more, I know that currently Files does not behave in this role as it should. One user had sent me a script to write Files as a default handler and noticing that it didn't work well:
#!/usr/bin/python2.6
from LaunchServices import LSSetDefaultRoleHandlerForContentType, kLSRolesViewer, LSSetDefaultHandlerForURLScheme
from CoreFoundation import CFPreferencesCopyApplicationList, kCFPreferencesCurrentUser, kCFPreferencesAnyHost, CFPreferencesSetAppValue, CFPreferencesAppSynchronize
applicationBundleIdentifier = "info.filesmanager.Files"
LSSetDefaultRoleHandlerForContentType("public.folder", kLSRolesViewer, applicationBundleIdentifier)
LSSetDefaultHandlerForURLScheme("file:///", applicationBundleIdentifier)
applicationIDs = CFPreferencesCopyApplicationList(kCFPreferencesCurrentUser, kCFPreferencesAnyHost)
for app_id in applicationIDs:
CFPreferencesSetAppValue("NSFileViewer", applicationBundleIdentifier, app_id);
CFPreferencesAppSynchronize(app_id);

If you guys are really interesting in this functionality - I'll do some research on the problem.
As for command-line controlling - that's a separate feature and I think it would be quite entertaining to code it :)

User avatar
darek
Posts: 179
Joined: Thu Jul 16, 2015 4:50 pm
Location: Warsaw, Poland
Contact:

Re: Ability to reveal file/folder by passing commandline arguments

Post by darek » Tue Nov 03, 2015 6:03 am

Oh, I was just asking because the way you've said it it seemed as it was some obvious setting that I've missed ;) Personally, I don't care about this feature, it's very low on the priority list. I'd expect it wouldn't work reliably in all places anyway, as various programs may implement "Show in Finder" feature in various ways.

So yeah, I don't think it's worth chasing now. It's better to focus on things with more impact.

One more thought. Canab said:
But I think most people who need special application for file management somehow related to software development.
And I definitely agree. Again, it's like with Sublime Text. Their target is very clear and focused: programmers and hard core text users. For regular folks there are dozens of different editors, but guys like me know why they love ST and they're ready to pay the price. It's the same with Files. Regular people won't switch from Finder even if Files were free. But for me the lack of Total Commander on OS X hurts almost every 30 minutes. I know how fast I can go on PC and I know how Finder slows me down. Files is a tool for pros so it has to prioritize features that pros will love.

Also, while I'm here... Did I talk about the title recently? ;) I don't think Sublime would go anywhere if it was called Text Editor.app ;) Unique tools for pros need unique names. Common names are for common people and things distributed in the system by default. But even Apple's movie making app for pros isn't called Movies.app but Final Cut Pro X. Ok, just saying ;)

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

Re: Ability to reveal file/folder by passing commandline arguments

Post by mike » Sat Nov 28, 2015 8:12 am

Guys!

I've made Files serve as "Show in Finder" (almost).
This menu item does not change, but after clicking it effectively uses Files instead of Finder to show selected items.
To do it, you can use Python script from above (not recommend to, since it will overwrite all app's NSFileViewer setting) or write manually this setting for app you need via terminal:
defaults write APP_BUNDLE_ID NSFileViewer info.filesmanager.files

Apps in which it worked for me (didn't tested with many however):
- Safari
- Xcode
- Sublime Text 2
- VLC

Didn't worked:
- iTunes (will investigate the reasons why)

Will upload new build today if somebody is interested to play with it.

Mike.

User avatar
darek
Posts: 179
Joined: Thu Jul 16, 2015 4:50 pm
Location: Warsaw, Poland
Contact:

Re: Ability to reveal file/folder by passing commandline arguments

Post by darek » Sun Nov 29, 2015 7:42 am

Mike, are you sure that command is ok? With "APP_BUNDLE_ID" and such? It kind of looks like a template...

Locked