The macro consists of only 2 actions and both are wrong !
1- prompt for file. Instead of all the files in the folder, I would like to select from only those files which contain KBM in the title. What should I write in the title field ? I tried just writing KBM as if the field meant 'title contains' but I still end up with a listing of all files in the folder.
2- open file: if I pick a file in the prompt for file action and send it to a variable, I am unable to open that file using the variable name
As the KM wiki entry for Prompt for File says, the Title field is for setting a title for the prompt. As far as I know, there is no way to filter files by words contained in their name with this action, though you could conceivably make your own file prompt with Prompt with List and For Each like so:
The "Title" field is NOT a search field. It is just for information that is displayed with the Prompt is shown.
One good solution is to use an AppleScript to build a special file list that is: POSIXpath__FileName
and use this list in a KM Prompt with List.
Use of the two underscores causes only the text to the right to be displayed, but the text to the left is the actual data that is returned.
The script returns ALL files in the Target Folder, but you can easily filter the list by typing any characters in the file name.
Below is just an example written in response to your request. You will need to use as an example and/or change to meet your workflow automation needs.
a superb macro. I like the fact that the search function is independent of the order of the words in the filename
1- choose file from folder selected in Finder: very useful macro ! I would prefer Pathfinder to Finder. I tried changing Finder to Pathfinder in the script but it did not work.
2- I would like to create multiple variants of the script, each with a fixed folder (not the one selected in PF or Finder). How would I modify the script to achieve that ?
so I solved my problem by simply adding the following action before the script. I don't need that change Finder to Pathfinder and I don't need to modify the script to make it folder specific.
It will use whichever is frontmost, Finder or PF, OR can use a preset Target Folder path.
It also will allow you to change Target Folder after you are in the list.
the macro is an absolute gem. I use it many times a day.
I am curious as to why there is a significant delay before the dialog box appears and if there is anything I can do about it.
thanks very much