script unfunction
Hi experts,
my script like this:
var
cName, mLinks, cLink, matchCount = 0,
checkLinkName,
manual = false;
if (cFile.name.match(/\.indb/i))
manual = true;
else {
mLinks = cFile.links.everyItem().getElements();
while (cLink = mLinks.shift()) {
cName = cLink.name.match(/[ec]\d{4}_..\.eps/);
if (!cName || !cName.length) continue;
cName = cName[0].split(/_..\.eps/)[0];
matchCount++;
}
if(matchCount > 1 || matchCount == 0) manual = true;
}
if (manual) {
var
ourstockcode = mDialog();
manualStockCode = String(ourstockcode);
cName = manualStockCode;
}
cTime = new Date;
if (!File(cPath.exists))
Folder(cPath).create();
cName += ".pdf";
return File(cPath + cName);
}function mDialog ()
{
var
w = new Window("dialog","Input Stock Code", undefined, {closeButton: false}),
p = w.add("panel"),
mLine = p.add("group"),
mStat1 = mLine.add("statictext", undefined, "Stock code:"),
mEdit1 = mLine.add("edittext", undefined, ""),
mB = w.add("group");
mB.add ('button', undefined, "取り消す", {name: "Cancel"});
mB.add ('button', undefined, "OK", {name: "OK"});
mLine.alignChildren = "left";
mEdit1.characters = 8;
mB.spacing = 50;if (w.show() == 1)
return Number(mEdit1.text);
else exit();
}
if the link like this :
I suppose the file name will like this:
but it return to:
how can I fix it.
thanks
regard
John
