A Few Favorites Macro (v9.1)

Glad to hear that's resolved. Yes, it does come up quickly when it finds what it's looking for. Enjoy!

I've been working with it every chance I get, and using it constantly....It is definite time/repetition saver.. Thanks again

Glad it's working out for you. Thanks for the feedback!

This is fantastic! Thank you for the work!

I'm running into some consistencies with getting it to work with added folders. Sometimes it works, and sometimes I get a "nonexistent path" error.

Open file failed with non-existent path "%Variable%localPath%"...Macro "A Few Favorites"...

The thing is, if I keep re-adding the folder, it might work on the first try then stop working, or it might not work at all. Any ideas of what's going on?

I'd guess the path in folders.txt doesn't exist on your hard drive for some reason. To investigate, edit folders.txt with either of the buttons shown below to find the problem folder:

ss

Nothing seems wrong. Here's the entire file. The duplicates are there because I've been testing and experimenting.

Favorites: Folders

General
Home /Users/[username] @hom, @d
Documents ~/Documents @d
Downloads ~/Downloads @d
Pictures ~/Pictures @pix, @d
Library ~/Library @lib, @d
Auto EntryAuto Entry
videos to watch ~/Dropbox/zzz edw Desktop/ shh/ on my desk/videos to watch:processAuto Entry
misc stuff ~/Dropbox/zzz edw Desktop/ shh/ on my desk/misc stuffAuto Entry
insta downloads ~/Dropbox/zzz edw Desktop/ shh/ on my desk/insta downloadsAuto Entry
q qsync overflow ~/Dropbox/zzz edw Desktop/ shh/ on my desk/links/q/q qsync overflowAuto Entry
q videos to keep ~/Dropbox/zzz edw Desktop/ shh/ on my desk/links/q/q videos to keepAuto Entry
videos to watch ~/Dropbox/zzz edw Desktop/ shh/ on my desk/videos to watch:processAuto Entry
misc stuff ~/Dropbox/zzz edw Desktop/ shh/ on my desk/misc stuffAuto Entry
insta downloads ~/Dropbox/zzz edw Desktop/ shh/ on my desk/insta downloadsAuto Entry
dropbox ~/Dropbox/zzz edw Desktop/ shh/ on my desk/insta downloads

I can't see everything I should (leading tabs, for example), but I do see some obvious errors.

  • Remove the "AutoEntryAutoEntry" line after "Library"

  • Remove the "Auto Entry" from the end of every line that starts with a tab.

As a general practice, when I automatically add an entry, I always edit the file right away to put it in the category I want. You aren't using categories, but every time you add a folder, an Auto Entry category is added.

Your file should look like something like this:

# Favorites: Folders
General
	Home	/Users/[username]	@hom, @d
	Applications	/Applications	@d
	Documents	~/Documents	@d
	Downloads	~/Downloads	@d
	Pictures	~/Pictures	@pix, @d
	Library	~/Library	@lib, @d
Auto Entry
	my other stuff	~/Documents/my other stuff	@stf

I think that fixed it. I was just letting the macro automatically add the folders, but after I removed all the duplicate "Auto Entry" text, it seems to be working fine.

Also, I didn't realize I could create different categories like that, so that's a great tip.

Thanks for the help!

Glad that helped.

Make sure to end the file with a Return so when "Auto Entry" is appended to the file it's on its own line. That's why the folders weren't found. They all included "Auto Entry" in their names.

The categories are helpful in the HTML prompt but don't exist in the popup, although you can simulate them with tags, as the sample files show.

1 Like

Just updated the download up top. It was driving me crazy not to have a double click in the HTML form. From the release notes:

3.3a on 13 February 2021

  • Support for double clicking options in the HTML form added.

FYI, just a minor update to A Few Favorites to guarantee the last run backup is remembered and add a title tab and revision number to the HTML interface.

1 Like

A Few Favorites v4

This macro opens apps, files, folders (including mounted drives) and -- (in version 4) opens URLs and pastes email addresses -- using either an HTML form or a Popup menu.

Apps are launched or, if already open, switched to the front. Files are opened by the default application. Folders can be opened in the Finder or an Open/Save dialog. Any URL protocol will open in a new tab in the front browser. Email addresses are pasted into the front window.

Lists of the various options are kept in separate text files you can access for editing directly from the macro.

ACKNOWLEDGEMENTS

This macro was inspired by two other macros:

It has also been inspired by feedback from earlier versions.

DEFAULT HOT KEYS

Version 4 is a change from earlier versions, using variations on the familiar space key used for other launchers like Spotlight.

  • Control-Shift-Space to call the HTML interface

  • Control-Space to call the Popup interface

  • Option-Shift-Space to add the Finder selection to a favorites file

FAVORITES FILES

The five favorites files (apps.txt, files.txt, folders.txt, urls.txt, emails.txt) use the same data format):

Heading

[tab]Descriptive Name[tab]Path[tab]@shortcut, @shortcut

Tilde is supported in the path (eg: ~/Documents rather than /Users/username/Documents).

Lines beginning with # are treated as comments.

Headings, which are only used by the HTML interface, are optional and ignored by the Popup list.

The listing can include a tag as a shortcut or even a filter indicating whether the path is to a folder or a file. The macro figures it out itself for the HTML form but the Popup can use a filter for navigating the lengthy list.

One character filters you may find useful include @a (for apps), @d (folders), @f (files), @u (urls), @e (emails). By typing just those two characters in the Popup interface, you can filter the list of options to that category.

These shortcuts are optional and disregarded by the HTML form.

OPERATION

On first run, you'll be prompted for the location of your favorite app, folders, files and URLs files. There are four: apps.txt, files.txt, folders.txt and urls.txt to facilitate adding Finder selections to the correct list.

Sample files are provided in the distribution, along with an images folder with the HTML interface's icons.

The HTML interface displays a separate list for apps, files, folders, URLs and emails with a label that is also a button to edit that list. The active list is indicated by a highlighted border in the HTML form. You can tab between lists. By default, you are addressed to Files. Tab to address Folders. Shift-Tab to address Apps. A Help button displays most of this information.

You can navigate the HTML form by typing the name of the item you want or repeatedly typing the first letter. When you have arrived at the item you want, just type Return or click the OK button on the HTML form. You can also double-click an entry.

The Popup simulates the HTML buttons with a "[Text]" convention. It has four options that begin with "[Edit" at the bottom to edit any of the four source files, as well as a "[Help]" option.

You can navigate the Popup by typing the item's name or its tag to narrow the list. Press Return or double click on the item.

If you select an app, the macro will launch the app or, if it's already running, switch to it.

It will open any favorite file in its default application.

If you select a folder with an Open/Save dialog is at the front, the macro will redirect the dialog to the appropriate folder, otherwise it will open the selected folder in the Finder.

You can add a selected app, file, folder or URL webloc in the Finder, by using the Option-Shift-Space hot key. The macro will ask how you want to add it to the appropriate source file. If you add it, you'll be asked if you want to edit the file so you can move the new listing.

A URL webloc is simply a URL dragged from your browser's URL field to the Desktop. A typical webloc might, for example, appear as "https--en.wikipedia.org-wiki-List_of_URI_schemes" on the Desktop. The macro reformats that file name into a legal URL.

Email addresses must be manually entered into emails.txt since only Finder selections are read by the macro. They are pasted using the email convention of "Recipient Name email@address" so email clients show a readable name but use the email address.

Listings are not sorted by the macro. You can order them however you like and that's how they'll appear.

INSTALLATION

The macro is installed in its own macro group named MacroApp: A Few Favorites as A Few Favorites, available to all applications all the time. You will have to enable it, however.

The default hot key is Space with various modifiers that do not conflict with Spotlight:

  • Control-Shift-Space to call the HTML interface
  • Control-Space to call the Popup interface
  • Option-Shift-Space to add the Finder selection to a favorites file

Favorites ships with sample favorite files you can copy to a folder in a convenient location along with a subfolder of icons the HTML interface requires. The macro will ask for the location of that folder on first run.
You can populate those files by selecting apps, folders, files and URLs but you'll want to manually edit them into helpful categories if you use the HTML form.

There is only one global variable used (favsHome). It remembers where your text files are. All the other variables are locals that are not saved.

Icons are from the IcoMoon-Free set from Keyamoon (http://keyamoon.com). They are installed with the favorites files in a sub-folder names "images."

CUSTOMIZATION

You can change the hot key, of course. I choose the Space key to match other launchers I use.

And you can swap which interface requires the Shift key by making the Shift the pressed modifier and deselecting it in the not pressed row of the appropriate If action.

If you use rather long stubs to describe your paths, the width of the HTML "select" field will grow and push the others to a new row, obscuring them. Keep your slugs to no more than 18 characters to avoid this. Alternately, you can widen the window.

You can pick which of the five HTML "select" lists gets focus by moving the "autofocus" option to the "select" you prefer. The default sets Files to autofocus so Shift-Tab moves to Apps and Tab moves to Folders.

NOTES

I've established a different tag for apps, files, folders, URLs and email addresses so I can filter the list in the Popup interface: @a is for apps, @f for files, @d for folders (directories) and @u for URLs. And buttons all begin with "[". That can provide a similar function to the four "select" lists in the HTML form.

I've set variables to check for the Shift and Option keys to avoid any processing delay caused by the initial code that would miss the key press.

I've also put a short Help text (based on this document) in a variable because it appears twice in the macro. This way the text is stored only once and, as a local variable, not remembered outside the macro.

The macro distinguishes file types by the extension. It knows .app is used for .apps and any other three or four character extension is a file. URLs are distinquished by the URL protocol delimiter (://). Anything else is assumed to be a folder. This has worked reliably in my testing.

The Option key replaced an earlier version which just looked for a Finder selection. I found that I often had a Finder selection somewhere, which I had no intention of adding to a favorites list. So I reverted a more conscious implementation over automatic. You always know when you want to add a selection to a file.

You can also add multiple selections to a variety of files, too. You'll be prompted for each one.

And you can add external and internal drives to the folders list as well.

Adobe Open/Save dialogs are unmoved by this macro. Otherwise it has worked well with the applications we've used.

For the full documentation, see the PDF that accompanies this post.

A Few Favorites.4.zip (21.1 KB)

Favorites.pdf.zip (709.3 KB)

5 Likes

This is one of my personal TOP 5 macros that I've found on this forum. In companion with Zabobon’s Dynamic Workspaces which handles precise window opening and placement for apps, I can now browse "a few favorites" folders and files no matter where they're stored. Big fan of the HTML interface.

Maybe few suggestions:

  1. I was unable to recreate it first. Post on the top of this thread still includes zip archive version 34a.zip and doesn't include all .txt files necessary.
  2. also icons are missing. I downloaded the whole free pack and was searching for correct icons from your screenshot. Still can't find the right one for the Email category :man_shrugging:
  3. I have tried to add a MIDI trigger for Control-Shift-Space like a substitute for launching an HTML interface, but instead "popup interface" keeps showing up.

Other than that, great work! Thank you!

1 Like

Oops, sorry. I uploaded the wrong file (just the macro not the .zip with the support files). Fixed above. Thanks for pointing that out.

Included in the new upload. Email is 070-envelope.png.

Two steps. First make sure both triggers are set at the top. Then somewhere in the middle of the macro (Switch to Preferred Interface) you'll find an If statement that checks whether the Shift key was used in the trigger. You get the popup if the Shift key was not used. So you'll want to change that test to get the popup if the trigger is not your MIDI trigger.

1 Like

Work like a charm! Thanks!

1 Like

Very impressive thanks for sharing.

2 Likes

My pleasure!

1 Like