MetaEdit plugin

Hey! So, there’s actually an undocumented API function called createYamlProperty. The way I usually approach it is to first check if a given property exists, and then either create or update it using the API:

// MetaEdit API Interface functions
autoprop: (propertyName: string) => void;
update: (propertyName: string, propertyValue: string, file: TFile | string) => Promise<void>;
getPropertyValue: (propertyName: string, file: (TFile | string)) => Promise<any>;
getFilesWithProperty: (propertyName: string) => TFile[];
createYamlProperty: (propertyName: string, propertyValue: string, file: TFile | string) => Promise<void>;
getPropertiesInFile: (file: TFile | string) => Promise<Property[]>;
7 Likes