Quick Switcher not recognizing some aliases

I’m not sure if this is a bug or a change associated with the deprecation of alias, so I am posting here first. I have a number of files with aliases that are no longer recognized by the Obsidian Quick Switcher. However, the aliases are still recognized by both Dataview and Bases. I am running Obsidian v1.9.2.

Looking into this further, I think this may be due to a change in how Obsidian creates the frontmatter when I enter the aliases into the Properties panel. Older files are in the format:

aliases:  SFO

or

aliases:  SFO, San Francisco Airport

while newer files (which are still recognized by Quick Switcher) are in the format:

aliases:
  - SFO

or

aliases:
  - SFO
  - San Francisco Airport

I’m not sure when Quick Switcher stopped recognizing the older format, but I believe it was fairly recently. I find it odd, though, that Bases does recognize the older format, and in the case of the second example recognizes it as two distinct aliases.

If the former is no longer valid, is there a way to quickly update all of my older notes without going in and manually updating each one? This would be pretty simple for notes that only have one alias, but not so simple (at least at my knowledge level) for multiple aliases.

There are some plugins that aim to do Global Search and Replace within Obsidian, but I haven’t successfully gotten any of those to work. I use VScodium (VScode without telemetry) for this purpose. But I’m sure there are other options.

Regardless, when doing large scale modifications to your vault MAKE SURE YOU HAVE A BACKUP! One wrong character could ruin a large number of files.

That said: Depending on the variety of aliases you need different Search/Replace phrases.

So in the Search field, you would enter aliases: and
Replace:

aliases: 
  - 

This should add the first hyphen. If that worked, you can then do the following

Search: ,
Replace:


  - 

This should turn commas into a newline plus another hyphen.

Again, please create backups before trying anything.

That will work for the first alias, but not for any after that. The search and replace you proposed would replace all commas everywhere, not just in the aliases property.

Whoops, you’re right, sorry! That’s why I mentioned the backups lol, I’m sure I’ve done stuff like that to my vault.

In that case you could use regular expressions in VScode to define that the comma has to come however many characters after aliases: . Maybe that’ll work?

Yes, this is due to changes in how Obsidian handles properties. You can get the details in the changelog and in the Insider channels on Discord.

2 Likes

Thank you, @CawlinTeffid