get svg file path from clipboard

PHOTO EMBED

Tue Dec 06 2022 13:07:29 GMT+0000 (Coordinated Universal Time)

Saved by @savabeh191

if (clip.ContainsFileDropList()) {
    var clipFileList = clip.GetFileDropList();
    if (clipFileList[0].includes(".svg")) {
        var svgFilePath = clipFileList[0];
        var base64Img = clr.System.Convert.ToBase64String(clr.System.IO.File.ReadAllBytes(svgFilePath));
		var imgHTML = "<img alt='Clipped Image' src='" + "data:image/svg+xml;base64," + base64Img + "' />";
		clip.SetText(imgHTML);
    }    
}
content_copyCOPY

The script is to get svg file path from clipboard, read it, convert it to Base64 string and output HTML code to clipboard.

https://forum.strokesplus.net/posts/t8263-Scripts-to-convert-clipboard-image-to-HTML-code--Base64