Open File By Name?

kshaw-wd

Registered
I have a directory filled with files named like:

asdfqwe4pr89hjq134r091j34rt-09u13405ru[adfshiga.something

Scrolling to find the file is really tedious
If start entering the filename in search it searches the entire mac.
Command shift g opens a folder. Is there a way to type in a filename and have that file opened, other than from the command line?
 
I have a directory filled with files named like:

asdfqwe4pr89hjq134r091j34rt-09u13405ru[adfshiga.something

Scrolling to find the file is really tedious
If start entering the filename in search it searches the entire mac.
Command shift g opens a folder. Is there a way to type in a filename and have that file opened, other than from the command line?

These don't appear to be legitimate files, but you could try using a plain text editor like TextEdit in your Applications folder.
 
This reveals the file in finder:

open -R blah


-----------

Oh... actually, I found out a way that would work some times. From the command line:

open -a FloopBart asdfaqwefq8jw0-e9f8jqw0e8f.asdfjpqwef

Opens the file with FloopBart.app

I would still rather do something like pressing Command+G filename, because I don't want to open a new instance of a program in order to open the file, usually.

Command+G doesn't work because that opens a folder instead of a file.

--------------
I mean to ask how to find the file in order to open it. I know what the file is and which program is meant to open it. I just don't know an easy way to find the file in order to open it.

Since the name is not easy for me to remember, scrolling through finder to find it is a pain. If I type the name into the search window in finder it searches the entire mac. Is there a way to say "open the file named blah", instead of scrolling to find it, and instead of searching the entire mac for the file? This is in a particular application, but it is using a standard mac file finder popup that acts like finder.
 
Last edited:
That searches the entire mac. And, in the current situation, that would find thousands of similarly named files all over the place.

I'm looking right at the folder the contains the file. If I could just type the name it would take a fraction of a second. Scrolling through thousands of similarly named files over and over is not fun. So, having a command line open to the folder in which I am reading and writing files and typing open -R blah<TAB> to open finder and highlight the file is the best I can think of at the moment.
 
If you have the folder already open, then you can type the name of the file. The finder will follow as you type, and the file that you want will quickly be highlighted.
It has to be a continuous typing on your part, as it is a sorting method as you type.
You will likely find that doesn't work effectively, if your file names are really long, and you have thousands of files in the folder, as you say.
But the sorting method by typing works pretty good, as long as you know what the filename is.
And, you can have a smart folder that would have only the files that you need - because you decide what files go in the smart folder.
The smart folders use Spotlight, but YOU decide what criteria to use for files to list in a smart folder.
Look in your help menu for more information on how to quickly see and open files, and also how to use smart folders.

If that is not helpful for you (and not everyone uses or appreciates OS X smart folders), there are other apps that can help you more easily work with files and folders,
Here are a few examples, such as:
Hazel, or
Pathfinder, or maybe
TotalFinder
 
With finder open, looking at the folder that contains the file that I want to open, select, operate upon, if I type the file name, it searches the entire mac, not the folder that I am looking at. So, after some time presumably the file I am looking for would appear in that list. But, that is far too slow for me to do more than once or so before looking for a faster approach.

I noticed that I can change the search field to look at recently viewed folders instead of the folder that I am looking at. But, presumably because the file isn't in any of those folders, after a couple of keystrokes it switches back to searching the entire mac.

If I understand correctly, creating a smart folder would mean I had first selected the file and then put the file into the smart folder. But, it is that first part that is what I am trying to achieve: get at, open select, etc. the file the name of which I could type.

I frequently use folders that were just created after extracting files from an archive. Often, there is significance to there being a folder. For example, source code control system folders. So, creating a folder or moving files from one folder to another when I have I want to open a file is cumbersome.

Do you know if any of the applications you describe allow you to open a file in the folder that you are looking at, by name?
 
You need to learn more about smart folders. They are not really a search tool, but IMHO are a "results" location. There is a big difference.
You don't need to put any file manually in a smart folder, even the first one (unless you want to do that)
Typing in the search window in any finder window (not just a smart folder) does use spotlight, and it will search your hard drive, or whatever folders that you have set in Spotlight preferences.
The search window ALSO looks at file content, so the search results can take longer from that search box.
(If it is REALLY slow, you can likely speed the search by rebuilding the Spotlight database, something that you may want to do anyway if you haven't even done that (rebuild the spotlight database)

But, you don't have to use the search box if you don't want to search everywhere
Just open a new Smart folder, then click the plus (+) near the top right corner
That will show the first criterium for the smart folder. Click the (+) again to add more criteria for files that exist in the smart folder.
Look what happens when you change the first criteria to "name", then type the first few characters of a name that you typically look for. It really is that fast!
Click the (+) a few times, and you can see a list of additional search criteria, including clicking on Other... - which will show you many more choices. You can really drill down to very fine distinctions with the smart criteria.
Click save to save that smart folder, with its criteria as you have chosen them. Remember that the smart folder doesn't actually move any files or folders, it is simply a location to view the set of files and folders, with search criteria that YOU choose.
If you open that smart folder (or ANY folder) and simply start typing the name, a smart folder will quickly show you the file that you are looking for (without clicking in the search window. Neat!
You do need to experiment (try it out!) to be more aware of the simple steps that you need with a smart folder.
You get to the file that you like, then simply Command-O to open the file with the default app, whatever it is.

Not everyone appreciates Apple's Smart Folder, and I get that. Try it out, use it for a few different sets of file criteria. I think you will begin to understand how it works - more than you do now.
And, then try any of the other tools, or search for other finder replacements, or file assistants, or folder utilities, etc. Some are better than others.
But, give Smart folders a chance, so you can see how they work. Stay away from the search window at first. just open the window, and begin typing the file name. You will see the list of files show starting with what you type, as you type, determined by your choice of criteria.
 
With finder open, looking at the folder that contains the file that I want to open, select, operate upon, if I type the file name, it searches the entire mac, not the folder that I am looking at.
I find this behavior odd, on my system (El-Capitan) a search in a Finder window defaults to searching in that Folder with a choice to select the whole system.
I've added a photo for clarity.

Screenshot 2016-03-11 at 8.22. AM.png
 
The difference in search in finder might be because the folder I am looking at hasn't been indexed yet. Maybe. I am using Yosemite and can't yet upgrade to El Capitan. If it is not because it hasn't been indexed yet, then that seems hopeful that maybe there is something unusual I am doing to make search within the folder work.

Smart folders and spotlight both seem like very useful things. Saved searches is a great idea. Not having to go through the process of repeating a search when it is the same sort of result that you are after day in and day out, is a great idea.

I don't see how this applies to the problem at hand though. Using a smart folder would come up after having achieved the goal here. How to achieve the goal of finding the file in the first place, in order to operate upon it, is the problem.

There is probably a difference in how I use the file system due to the sorts of tasks I am performing. If you are a writer or a graphic artist, you might accumulate the same sort of files that you use all of the time. Keeping your assets in a standard place makes sense then and you can take advantage of searching abilities that ship with macos to find and organize assets.

If you are a computer programmer and you are not doing the same sort of programming over and over day after day, there is no concept of standard assets to be organized and searched that applies. For example, blah/something/File.befunge is in the folder blah/something, for a reason. On the entire mac, File.befunge could occur very many times in different folders and mean different things. Worse is like the example I'm talking about where there is a file with a name containing a randomish sequence of characters among hundreds of other files in the same folder that you would have to look very closely at to differentiate in order to scroll to find them.

I can't gather links to thousands of files in different folder structures into a smart folder, so that I can then search them. When those folders could have been created 1 second ago and will disappear 5 minutes into the future.

Or, it would be very cumbersome to go through that process and much more time consuming than typing open -R File and pressing the tab key. But, having to open a terminal and type commands in order to then use finder, is slightly ridiculous it seems to me. But, not as ridiculous as very laborious mouse moving just to be able to find a file.

That doesn't mean smart folders or spotlight are not great things.
 
The difference in search in finder might be because the folder I am looking at hasn't been indexed yet. Maybe. I am using Yosemite and can't yet upgrade to El Capitan. If it is not because it hasn't been indexed yet, then that seems hopeful that maybe there is something unusual I am doing to make search within the folder work.

Smart folders and spotlight both seem like very useful things. Saved searches is a great idea. Not having to go through the process of repeating a search when it is the same sort of result that you are after day in and day out, is a great idea.

I don't see how this applies to the problem at hand though. Using a smart folder would come up after having achieved the goal here. How to achieve the goal of finding the file in the first place, in order to operate upon it, is the problem.

There is probably a difference in how I use the file system due to the sorts of tasks I am performing. If you are a writer or a graphic artist, you might accumulate the same sort of files that you use all of the time. Keeping your assets in a standard place makes sense then and you can take advantage of searching abilities that ship with macos to find and organize assets.

If you are a computer programmer and you are not doing the same sort of programming over and over day after day, there is no concept of standard assets to be organized and searched that applies. For example, blah/something/File.befunge is in the folder blah/something, for a reason. On the entire mac, File.befunge could occur very many times in different folders and mean different things. Worse is like the example I'm talking about where there is a file with a name containing a randomish sequence of characters among hundreds of other files in the same folder that you would have to look very closely at to differentiate in order to scroll to find them.

I can't gather links to thousands of files in different folder structures into a smart folder, so that I can then search them. When those folders could have been created 1 second ago and will disappear 5 minutes into the future.

Or, it would be very cumbersome to go through that process and much more time consuming than typing open -R File and pressing the tab key. But, having to open a terminal and type commands in order to then use finder, is slightly ridiculous it seems to me. But, not as ridiculous as very laborious mouse moving just to be able to find a file.

That doesn't mean smart folders or spotlight are not great things.
If the folder has not been indexed yet, then a better reason to reset the spotlight database.
Open System Preferences, then Spotlight, and click on Privacy tab. Drag your hard drive into that pane.
The existing spotlight will immediately be deleted. I usually quit System Preferences, then reopen to the same Privacy tab in the Spotlight pane. Click on your hard drive there, then click (-) to remove the hard drive entry.
Give your system maybe 30 minutes, maybe longer to rebuild the spotlight database. It's a good task to start, then find something else to do (take a break, eh?) for a while.

hmmm - you use smart folders to find your files, and have them available immediately, then also have the list of files found update, regardless of their actual folder location. That's the fun of using Smart folder.
And, the smart folder updates as you add more files, and also updates when you remove relevant folders or files from their respective locations.
This has everything related to your search results. It also is completely under your control when you set up your search in the first place, and the smart folder allows you to modify the search criteria used for the search AFTER your initial search, so the smart folder stays relevant when you change your search needs.
And, you are incorrect. You can show thousands of files in a single smart folder (which does not move the files, remember?) The smart folder simply gives you a central, easy to use results for a search.
Why would you have to create a smart folder AFTER you complete a search. It is a primary tool that you can use to make the search in the first place, and you can configure it for anything in your connected storage, including net storage, if you have that, too.

The smart folders are as good as you make them - but you do need to work with them for a bit to understand better how they work. You seem to not care about that - and that's OK. You are also free to continue to struggle with what sounds like a large mess.
Please find the time to either try smart folders, or one of the finder replacements that I linked, or some other "finder enhancer". Or you can continue doing what you are doing, and I can wonder why you came here asking for help, yet you don't think any of that help will actually help you.
You do need to try some of the alternatives (or try smart folders, as you clearly don't understand how they work)
Keep in mind that smart folders do NOT disturb your existing folders or file structure. You can use smart folders both to find your files (and only the files you want), and make the results easily available, and automatically updated as you add new files to your system.
 
There seems to be a misunderstanding. I want to operate on a file, one time ever. Indexing the entire computer to find a file one time and then never again (potentially), is not something I can do.
 
Yes, if there is a problem with the spotlight index, it can manifest itself with slow searches, or even completely missing files that should be found quickly and easily, if the database was intact.
Re-indexing is a reasonable fix.
The re-indexing is really just a response to a particular situation, as you presented it.
Once done, then the theory is that the system should maintain the database, and you shouldn't need to do that indexing again.

As you reported that you have been struggling with how to search for a single file, that's why I suggested it.
I would not characterize that as a waste of time, particularly when you next search for some different file, and it pops up in moments - because the spotlight database is then working as it should.
 
Is there a reason that these files are named with random letters and numbers? Wouldn’t it be easier (for the future) to name the files with relevance to what the file is?
 
Back
Top