Place browser.htm into the Defaults/Automation file together with browser.vbs.
p.s. I tried to pass parameters to the html file via
URL = Chr(34) & appPath & "\Defaults\Automation\browser.htm" & "?param1=first¶m2=second" & Chr(34)
but it doesn't work.
browser.htm:
Code: Alles auswählen
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Dialog</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<meta http-equiv="content-language" content="en-us">
<SCRIPT type="text/javascript"><!--
function generate() {
var str = "";
var radios = document.theForm.R0;
for (var i=0; i<radios.length; i++) {
if (radios[i].checked) {
str += radios[i].value + "|";
break;
}
}
var params = document.getElementsByName("param");
for (var i=0; i<params.length; i++)
str += params[i].value + "|";
str = str.substr(0, str.length - 1);
document.theForm.output.value = str;
document.theForm.output.select();
}
//--></SCRIPT>
</head>
<body>
<form name="theForm">
bit depth:
<input type="radio" name="R0" value="PT8Bit">8-bit
<input type="radio" name="R0" value="PT16Bit">16-bit
<input type="radio" name="R0" value="PT32Bit">32-bit<br>
<br>
width: <input type="text" name="param"><br>
<br>
height: <input type="text" name="param"><br>
<br>
resolution: <input type="text" name="param"><br>
<br>
<a href="javascript:;" onclick="generate(); return false">generate</a><br>
<br>
parameter string: <input name="output" size="64">
</form>
</body>
</html>
Code: Alles auswählen
Option Explicit
Dim doc, image
Dim fso, appPath, objShell, URL, params
Const PTRGB = 1
Const PT8Bit = 0
Const PT32Bit = 4096
Const PT16Bit = 8192
Set fso = CreateObject("Scripting.FileSystemObject")
appPath = fso.GetAbsolutePathName(".")
Set objShell = CreateObject("WScript.Shell")
URL = Chr(34) & appPath & "\Defaults\Automation\browser.htm" & Chr(34)
objShell.run URL, 1
params = InputBox("parameter string:")
params = Split(params, "|")
Set doc = CreateObject("PhotoLine.Document")
doc.DocumentMode = False
Set image = CreateObject("PhotoLine.Image")
image.InitPicture PTRGB+Eval(params(0)), Array(CLng(params(1)), CLng(params(2))), Array(1, 1, 1)
doc.RootLayer.Insert image, -1
doc.Resolution = CLng(params(3))