MACRO: Finder Assistant, v0.22

ScreenFlow



Finder Assistant – ReadMe Excerpt

Description

Finder Assistant is a Keyboard Maestro macro set that provides a means to complete common Finder tasks. Although there is no direct integration, used in combination with Alfred's Universal Actions, almost every Finder task can be completed with the keyboard.

Getting Started

Dependencies

Finder Assistant has been tested with Keyboard Maestro v11.0.2; however, it might function properly with v10.2. Moving forward however, due to the complexity of the macro set, there will be no attempt to support outdated versions of Keyboard Maestro.

Installing

  • Download and unzip the Finder Assistant zip file.

  • Install the main macro and supporting subroutine macros by double-clicking the macro export (file with the kmmacros extension). The main macro and 42 subroutines will be installed on a group named ⋮Finder Assistant.

  • Enable the ⋮Finder Assistant group and the primary macro: Finder Assistant. The 42 subroutines do not need to be enabled.

  • After running Finder Assistant and reading the introductory dialog and comments within the configuration file (i.e., Favorite Folders File), optionally copy the files within the Templates folder to the location instructed.

Configuration Settings

  • Macro Settings: Finder Assistant (FA) includes several configuration settings within the macro. These settings are identified with comments (magenta) and variable actions (orange). The default settings should be initially used and only adjusted after understanding the basic operation and features of FA.

  • Favorite Folders File (FFF): This is a plain text file that is created and managed by the macro, however, it can be also modified using any text editor.

  • File and Folder Templates: Default file and folder templates are provided, but others can be freely added at any time.

Hot keys

The primary and secondary hot keys for Finder Assistant,⌃⇧F and ⌃⌥⇧F, can be freely changed with one restriction: the secondary hot key must include the option key ().

Executing Finder Assistant

Finder Assistant is normally executed using the primary hot key. The response is context sensitive, based on the items selected (or not) within the Finder at the time the macro is started.

  • If one or more Finder items (files and/or folders) are selected, a menu is displayed that contains up to elevan options: Move, Keep, Enclose, Zip, Copy, Alias, Replace, Tag, Write, Navigate, Save.

  • If a Finder window is open, but no items are selected, a menu is displayed that includes three option: Write, Navigate, and Save.

  • If a Finder window is not open, or if one or more are open but none have focus, the Navigation menu is displayed.

  • The macro includes many other context-sensitive nuances that will be discovered as the macro is used.

If a macOS application (e.g., Preview) Open or Save dialog is open, the Navigation menu will appear if the secondary hot key triggers Finder Assistant. This can be used to quickly switch to a Favorite Folder.

Additional Information

Additional information is provided in the introductory dialog when Finder Assistant is first executed. The Favorite Folders File also includes helpful comments for configuration and operation.

Design Notes

  • Finder Assistant (FA) is a complex macro, but by employing context sensitivity combined with menu and dialog cues, and the overview documentation provided in Favorite Folders File (FFF), it should be relatively easy to understand.

  • The verbs used in FA (i.e., Move, Keep, Enclose, Zip, Copy, Alias, Replace, Tag, Write, Navigate, Save) used in Finder Assistant were selected so that menu selections could be made with the fewest possible keystrokes (i.e, each begin with a unique letter). For more information, refer to the FFF.

  • FA is designed to complete the various Finder tasks within the active Mission Control Desktop Space. It will effectively ignore Minimized (but not Hidden) Finder windows and also all Finder windows open in other Desktop Spaces.

Acknowledgments

This macro was inspired by at least five other macros:

Based on everything I’ve learned from others on this forum, there are probably other techniques I’ve borrowed from others. (If there are other macros that come to mind, please bring them to my attention so I can include the proper attribution.)


Finder Assistant – Miscellaneous information

Context Sensitivity: the options presented depend on the Finder selection (or non-selection)

For example, with FA's initial menu...

a. If a Finder window is open and one item (a file or folder) is selected (in this case ~/Pictures/2022/IMG_8503.jpg is selected), then the following will appear:

Note that the item selected is indicated in the Finder Assistant Options.

See below for more information about the eleven Finder Assistant Options—FAO's: Move, Keep, Enclose, Zip, Copy, Alias, Replace, Tag, Write, Navigate, Save. In the example above, the Replace option is excluded because the selected item is not an alias.

b. If a Finder window is open and two or more items are selected, then the following will appear:

In this case, selected items is indicated rather than a single filename. Again, the Replace option is excluded because none of the selected items is an alias.

c. If a Finder window is open and active, but no items (i.e., file or folders) are selected, FA keys off the frontmost Finder tab (which is always a folder) and presents a subset of the FAO's: Write, Navigate, Save:

For the example above, the 2202 folder was open in the frontmost Finder tab, but again no items were selected. In most cases, two (if item is a file) or three (if item is a folder) Save options will appear: one for the item itself (if it is a folder), one for the Parent folder, and one for the Grandparent folder. However, in the example above, the Parent (Pictures, i.e., ~/Pictures) is included, but the Grandparent (~) is not because it is already configured in the FFF.

d. If no Finder windows are open, or if one or more Finder windows are open, but if none are focused, the following will appear:

In the above case, the menu that normally appears first that contains the Finder Assistant Options—FAO's is bypassed, and the Navigate option is automatically selected and a menu is created and rendered based on Navigate and the folders configured in the FFF*.

Menu and Dialog Cues

a. Menu Cues

In addition to the single file selection (vs two or more files) feedback, FA also includes cues in the first one or more lines of each Prompt With List menu. Here's an example for the first FA menu:

Here's an example for the second FA menu (assuming Copy was selected from the first FA menu):

b. Dialog Cues

Example 1—If Navigate to ⇨ (some other folder) is selected from the Navigate menu, the following dialog appears:

Note that the dialog cues are also context-sensitive.

Example 2—If a folder named 2202 was selected using the above dialog, and Command (⌘) was not down, the following dialog would appear:

Note that this dialog includes several cues.

Example 3—If the Tag option is selected, the following dialog appears:

Overview Documentation provided in Favorite Folders File (FFF)

Admittedly, this documentation is terse, but it can serve as a quick memory jogger. As mentioned above, the FFF can be quickly opened from every FA menu using ⌃⇧return. Also, my thought was that FA's introductory dialog that suggests viewing this file would help users recognize the value of this information.


Macro Group

After installation, one macro, Finder Assistant, and 42 subroutine macros will be located in the ⋮Finder Assistant macro group.

Finder Assistant
𝗌.𝗳⇾AppendToFile
𝗌.𝗳⇾GetFavoriteFoldersContent
𝗌.𝗳⇾GetFavoriteFoldersPaths
𝗌.𝗳⇾GetFavoriteFoldersPrompts
𝗌.𝗳⇾PrependToFile
𝗌.𝗳𝗻𝗱⇾AliasItemToPath
𝗌.𝗳𝗻𝗱⇾CopyItemToPath
𝗌.𝗳𝗻𝗱⇾CreateNewFolderOrFile
𝗌.𝗳𝗻𝗱⇾CreateUniqueFolder
𝗌.𝗳𝗻𝗱⇾CreateUniquePlainTextFile
𝗌.𝗳𝗻𝗱⇾EncloseItems
𝗌.𝗳𝗻𝗱⇾GetActiveTabPath
𝗌.𝗳𝗻𝗱⇾HasFocusedWindow
𝗌.𝗳𝗻𝗱⇾KeepItemToPath
𝗌.𝗳𝗻𝗱⇾MoveItemToPath
𝗌.𝗳𝗻𝗱⇾NewFinderTabInSpace
𝗌.𝗳𝗻𝗱⇾NewTabOrWindowInSpace
𝗌.𝗳𝗻𝗱⇾NewWindowInSpace
𝗌.𝗳𝗻𝗱⇾ReplaceAliases
𝗌.𝗳𝗻𝗱⇾SetActiveTabPath
𝗌.𝗳𝗻𝗱⇾Tags
𝗌.𝗳𝗻𝗱⇾UnminimizedWindowCountInSpace
𝗌.𝗳𝗻𝗱⇾ZipToPath
𝗌.𝗽⇾AbbreviateFolderPath
𝗌.𝗽⇾AliasTarget
𝗌.𝗽⇾AreAllItemsAliases
𝗌.𝗽⇾AreNoItemsAliases
𝗌.𝗽⇾ChooseFolder
𝗌.𝗽⇾ChooseOrValidateTarget
𝗌.𝗽⇾ConvertPath
𝗌.𝗽⇾GetStartupDisk
𝗌.𝗽⇾IsFolderWritable
𝗌.𝗽⇾ItemType
𝗌.𝗽⇾LongToShort
𝗌.𝗽⇾PathsMatch
𝗌.𝗽⇾SearchListForPath
𝗌.𝗽⇾SelectionPaths
𝗌.𝘂⇾ListLineCount
𝗌.𝘂⇾ListLineN
𝗌.𝘂⇾ProtectUnderscores
𝗌.𝘂⇾StripComments
𝗌.𝘂⇾UnprotectUnderscores

Installation File

2024-04-08 Finder Assistant.zip (765.4 KB)

Macro-Image


Macro-Notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.

System Information
  • macOS 14.3.1 (23D60)
  • Keyboard Maestro v11.0.2

12 Likes

very cool @_jims !!

thx so much for your hard work!

Z

1 Like

Thanks for sharing @_jims
Impressed what you do with Keyboard Maestro.

1 Like

I've updated the OP with Version 0.21 of Finder Assistant. This is a required update as I mistakenly excluded one subroutine in v0.20.

If upgrading from v0.20, delete the current ⋮Finder Assistant macro group before installing the macros in the new zip file.

Very cool Jim.

I like the context sensitivity and use of subsequent menus, just to name a couple of features . Also the overview documentation and intro dialogue combined with the learn-as-you-use approach worked well for me as a user and for exploring some of your macro techniques. Very well done!

Regarding Alfred's Univeral Actions, are you firing the main macro and using its interface, or do you have multiple actions in Alfred firing sub macros?

Thanks for sharing your hard work.

EDIT: Maybe I misunderstood, and you meant that this macro and Alfred's Universal Actions take care of your Finder needs, not that you passed items to this macro via Alfred.

1 Like

Hi, @evanfuchs; thanks so much for the feedback. The information you've provided might motivate others* to give Finder Assistant a try.

*Others: Even if the full macro doesn't seem appealing, if you're interested in including some Finder automation in your macros, the group of macros might be worth the download.

I was hoping that these factors would make it easy enough to use without a separate manual. The main macro is a beast (frankly a bit embarrassing), but I can partially blame the content sensitivity for the complexity.

Dialogs can be a bit annoying so I tried to select logical defaults so that they could be dismissed quickly.

Also, if a dialog does not include a variable field, the non-default buttons can normally be selected using a tap of the first letter of the button. For those dialogs that do include one or more variable fields, ⌘ plus the first letter can normally be used.

The tag dialog (shown in the OP) is mammoth, but once you get the hang of it, it becomes a quick way to modify tags. Clearly this is one case where I opted to prioritize utility over aesthetics.

Yes, that's what I was attempting to communicate.

I had been a longtime LaunchBar 6 user, but a few months after I started creating Finder Assistant I primarily switched to Alfred.

The Alfred Universal Actions (UA's) are powerful, and if I had the time and energy, I could create UA's that would replicate everything in Finder Assistant. But since that's not a current priority, I just choose to use it and UA's together.

1 Like

I checked out the tag dialog and features and ran into an issue. The Repl button was not replacing the selected file's tags with the Tags Clipboard, but the Add button would add them. I think it may just be a typo in the 𝗌.𝘁𝗶⇾ReplaceTagsOfItems submacro, which is searching the variable jsFinderTagsClipboard and it is empty. Should that be jsFA_FinderTagsClipboard like it is in the 𝗌.𝘁𝗶⇾AddToTagsOfItems and other submacros?

The Tags Clipboard is a cool idea!

1 Like

@evanfuchs, thanks for reporting that issue.

I've updated the OP with Version 0.22 of Finder Assistant and addressed that issue. I also took the opportunity to reorganize all of the tag logic. The ReadMe file includes the details.

If upgrading from and earlier version, delete the current ⋮Finder Assistant macro group before installing the macros in the new zip file.

So what do the 42 helpful finder things do? :confused:

Is there a readme part or section of the post I missed?

From above...

Finder Assistant is a Keyboard Maestro macro set that provides a means to complete common Finder tasks.


The zip archive does include a readme but, aside from revision information, it doesn't include much more than you see in the OP

Above I included this disclaimer...

Normally when I share macros on this forum I like to fully document them. This is a BIG exception.

However,

  • the video in the OP provides a high-level demonstration of the features, and

  • the screenshots above do include considerable information that would be particularly useful after trying the macro set.

  • And the configuration file (which is created when the main macro first runs) includes some helpful quick-reference information.