How display all files in folder with a trigger before each file name

I use Scrivener a lot. All files have the -scriv extension and open with the Scrivener app (vaguely resembles Evernote but many more functions)
I am trying to figure out the simplest way to create a macro which does the following:

  • open the folder
  • display all the files in the folder (about 25 total). If need be I can reduce to 9.
  • before each filename, display a number / letter
  • simply by typing the corresponding letter/number, open the corresponding file in Scrivener
    Please note that the fact that these are Scrivener files is irrelevant. The could be Pages or Excel files.
    Thank you very much in advance for your time and help

Hey Ronald,

Please be more specific.

What folder?

Do you really want to open it in the Finder? Or do you just want to get the file names of the contained files?



1 Like

Here is a macro that does most of what you want.

  • It does NOT provide a letter/number to select the file
  • But all you need to do to select a file is just type the first few characters of the file name.
  • From there you can use the up/down arrows to select
  • Then just press RETURN to open the file.

It is possible to add a select by letter/number, but to be honest I’m not sure it is worth the effort. You would also give up a lot of cool features offered by the standard Choose File dialog (like sorting by different columns) and also give up use of powerful tools like Default File X.

I’d suggest that you give this a try for a while to see if it will work for you.

[MACRO:   Choose File to Open or Read into KM Variable @JXA](

**NOTE:  You will need to change the "SCPT__ParentFolder" to a folder your prefer.**  It is the first Action.
1 Like

thank you so much !!

thank you Chris. I will try out JMTX’s macro to see if it’s the solution.

Hi, I must have done sth wrong. thanks again very much
below error message and the macro which I edited to add pathname and file type

Hi Ronald,

@JMichaelTX said you should change the value of “SCPT__ParentFolder” in the first action.

You have changed the variables in the prompt.

1 Like

@Tom @JMichaelTX Thanks very much, Tom !! will try again

Thank you for the macro which now works.
I have default foder X, but use it the most basic way (save as …).
How could it be used to solve the same problem. I had not thought about it.
thanks again

OK, that's good.

Just to be clear:

Do NOT change the settings in the Prompt Action:

Change the Data in these Set Variable Actions:

1 Like

thank you VERY much for your explanations and making the smapshots. Have a nice weekend !

Just to mention alternatives – Alfred and LaunchBar also can be used for this sort of activity: display folder contents and select file action with hotkey.

1 Like

Thank you for your comment
Would you be so kind to indicate how it is fine with launchbar?

I would even dare to say that this is part of the core features of Alfred/LaunchBar :wink:

@ronald, if you are referring to @korm’s post:

Display folder contents:

  1. Activate LB with your hotkey
  2. Type something like “documents” to make your Documents folder show up
  3. If it is not already selected, then select it.
  4. Press…
  • Right Arrow to see the folder contents hierarchically
  • Spacebar to see the flat folder contents

Select file actions

  1. Navigate to the desired file in LB and select it. Now you can either…
  • type one of the preconfigured hotkeys, for example ⇧⌘R to rename the file or ⌥⌘A to assign an abbreviation. [1]
  • or press the Tab key to send the selected file. You can send it one of your actions, or you can send it to another folder, or to an application to open it, etc., many possibilities…

These things are also explained in the online help.

[1] If you don’t have memorized the preconfigured hotkeys, then simply click the top-most item to open the contextual menu:

1 Like

thank you very much !!! you opened a whole new world !

the folder name is Scrivener scriv files but Launchbar does not accept spaces in names. How do you get around that? thanks

Try “ssf”.

Then you should see it either at the top of the list, or further down. (You can scroll the list with the mouse wheel or the Arrow keys.)

If you find it further down, then select it and open it. The next time you try, it should appear at the top (or at least near the top), since LB will try to learn what you are searching for. (You are training it by doing, to say so.)

1 Like

Once you find the folder (or any item in LB), you can assign it your custom abbreviation (press ⌘⌥A). In this case I would use “SF” for Scrivener Files.
But use whatever mnemonic works for you.

Once you have selected the folder, if you press SPACE it shows you a flat list of items in that folder. Then you can type more characters to filter that list.

The only thing missing (but maybe @Tom knows a way) for me is to filter the list by file extension, like “png” or “scriv”; OR by file type, like “image”.

1 Like

thank you Tom

Thank you Michael