The Script:
function OnClick(clickData)
{
var cmd = clickData.func.command;
//cmd.RunCommand('Select *.ico');
cmd.RunCommand('Rename PRESET="FolderIcon"');
if (clickData.func.sourceTab.selected_files.count != 1) {
return;
}
var selFileName = clickData.func.sourceTab.selected_files(0).name ;
DOpus.output(selFileName)
var fso = new ActiveXObject("Scripting.FileSystemObject");
var iniPath = fso.BuildPath(clickData.func.sourceTab.path, "desktop.ini");
if (fso.FileExists(iniPath)){
var txtFileMeta = fso.GetFile(iniPath);
txtFileMeta.Attributes = 0; // Clear Read-Only + Hidden.
}
var txtFile = fso.CreateTextFile(iniPath, true);
txtFile.WriteLine("[.ShellClassInfo]");
txtFile.WriteLine("IconResource=" + selFileName + ",0");
txtFile.Close();
var txtFileMeta = fso.GetFile(iniPath);
txtFileMeta.Attributes = 3; // Read-Only + Hidden.
var currentPath = fso.GetFolder(clickData.func.sourceTab.path);
currentPath.Attributes = 1; // Read-Only.
var icoFileName = clickData.func.sourceTab.selected_files(0);
var fso = new ActiveXObject("Scripting.FileSystemObject");
var icoFileMeta = fso.GetFile(icoFileName);
icoFileMeta.Attributes = 3; // Hidden.
}
This Script Works fine, no problem, without this line
var cmd = clickData.func.command;
//cmd.RunCommand('Select *.ico');
cmd.RunCommand('Rename PRESET="FolderIcon"');
with the Rename Preset the ico file has been renamed with Unicode Bangla Characters āĻ
āĻ¨ā§āĻ āĻ¸ā§āĻŦāĻĒā§āĻ¨ āĻāĻŋāĻ˛ āĻ¤ā§āĻŽāĻžāĻā§ āĻ¨āĻŋā§ā§. āĻļāĻŋāĻ˛ā§āĻĒā§. āĻŽāĻ¨āĻŋāĻ° āĻāĻžāĻ¨ FolderIcon
Then the error appears. The Unicode Bangla Characters can not be written in the ini file. Is there any way to fix that. Thanks