Hi,
I'm kind of stuck.
I am creating a button that should create a new file from text.
The text is from a web page via windows clipboard and add a .srt extension.
Why javascript, it should still remove the diacritics and replace the spaces with -.
For renaming it works for me, but create file from windows clipboard via javascript = hitch.
Thanks, Leo, for the directions.
I don't speak much English and I thought the DOpus.GetClip command only applied to Dopus not JavaScript, now I'm finding other examples, nothing before.
Have a nice day and thank you again.
else {
// Create a FileSystemObject
var objFSO = new ActiveXObject('Scripting.FileSystemObject');
// Create a new text file with the filename
var objFile = objFSO.CreateTextFile(PathName, true);
// Write the contents of the URL shortcut to the file
objFile.Write('[InternetShortcut]\r\n');
objFile.Write('URL=' + ClipboardData + '\r\n');
// Close the file
objFile.Close();
}
Thanks so much for the tip and the directions.
I hastily did it this way, probably not optimal, but it's running now.
function OnClick(clickData) {
var ClipboardData = DOpus.GetClip("text")
//DOpus.Output(ClipboardData)
var objFSO = new ActiveXObject('Scripting.FileSystemObject');
var FileName = clickData.func.SourceTab.Path + '\\' + ClipboardData + '.srt';
DOpus.Output(FileName)
var objFile = objFSO.CreateTextFile(FileName, true);
}
I have removed the accents and spaces elsewhere, as follows