Creating dynamic stamps
I've been looking into stamps for quite awhile now. I have successfully made a few. At present, I'm playing around with "dynamic stamps" and had some success with creating a few of them as well. I've used the app.response which were easy to create. I was successful with my first attempt.
But, now I want to create the type of stamps that have a pop open interface which asks questions and some have check boxes and drop downs. I haven't found much on the internet as far as tutorials are concerned. I have looked into Thom Parker's book but Dimitri emailed back saying the book only covers very basic types of stamps and would not really be much of a help to me. I found this other website that can provide the types of stamps I talking about but they charge for them and which are secured and do not allow someone to edit.
After spending a tremendous amount time searching the internet I found only one script. So I copy and pasted it into a pdf of my own to play around with it. To my surprise it kinda worked. Somewhat that is. The interface popped open. The fields are fillable. But the rest doesn't work. I tried to create a template and use the name #MyFirstStampB. I only get the Company name to fill in, not the other fields (see the script). So, below is the script. Would someone please take a look at it and tell me how to make it work so I can move on and learn something about creating stamps? I would like to see it work so I can see where I can go with it.
Here's the script: ( a bit lengthy)
var dialog = { companyValue: "", accountValue: "", approvedValue: "", payValue: "",
commit:function (dialog) { // called when OK pressed
var results = dialog.store();
this.companyValue = results["txt1"];
this.accountValue = results["txt2"];
this.approvedValue = results["txt3"];
this.payValue = results["txt4"];
},
description:
{
name: "Account Information", // Dialog box title
elements:
[
{
type: "view",
elements:
[
{
name: "Company name: ",
type: "static_text",
},
{
item_id: "txt1",
type: "edit_text",
multiline: true,
width: 300,
height: 30
},
{
name: "Account Number: ",
type: "static_text",
},
{
item_id: "txt2",
type: "edit_text",
multiline: true,
width: 300,
height: 30
},
{
name: "Approved By: ",
type: "static_text",
},
{
item_id: "txt3",
type: "edit_text",
multiline: true,
width: 300,
height: 30
},
{
name: "Pay Bill: ",
type: "static_text",
},
{
item_id: "txt4",
type: "edit_text",
multiline: true,
width: 300,
height: 30
},
{
type: "ok_cancel",
ok_name: "Ok",
cancel_name: "Cancel"
},
]
},
]
}
};
if(event.source.forReal && (event.source.stampName == "#MyFirstStampB")) { if ("ok" == app.execDialog(dialog)) { var cMsg = dialog.companyValue; event.value = "Company\n" + cMsg; event.source.source.info.company = cMsg;
cMsg = "Account\n" + dialog.accountValue;
this.getField("AccountNumField").value = cMsg;
cMsg = "Approved\n" + dialog.approvedValue;
this.getField("ApproveByField").value = cMsg;
cMsg = "Pay\n" + dialog.payValue;
this.getField("PayBillField").value = cMsg;
} }
I hope someone can help. I really don't want to use this script, just learn from it. Well, thank you all for spending the time reading through this post. If you can help, I would appreciate it. Again, thanks.
