Automatically remove emoticon from file name using Templater

What I’m trying to do

I am working on further optimizing of my templates by Templater and below my template for the capture of a phonecall. So far I have been able to compile the desired filename based on various variables, including selecting the person from a folder (each person in my PKM has his own note) and after completing, moving the note to a specific folder (Events). Because all the contacts in my PKM start with “:bust_in_silhouette:”, this emoticon is also included in the filename. I would like to keep the contacts to start with this emoticon, because all the subfolders in the “3. Sources”-folder starts with an emoticon (organizations, books, movies, ideas, etc.).

Example of the outcome of the file name of this template: “230122 phonecall :bust_in_silhouette: Jon Doe plan road trip”

Now I would like to do a file rename via Templater (when making the note), where the new file name is the same as above, but without an emoticon. Then an Templater-action must be performed that removes the emoticon from the file name, without changing the other data. Due to my structure of the Templater-template (see below), the emoticon is always in the same spot in the file name.

Phonecall.md (534 Bytes)

Things I have tried

I’ve already tried with the syntaxes “tp.file.title.split” and also with “tp.file.title.slice”, based on the following pages:

With all my attempts I’m getting only parsing errors. I think it should be technically possible, using multiple variables (?). But with my experience in programming and logic, I can’t get it done by myself. Who wants/can help me further?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.