Thread View: adobe.scripting.indesign
1 messages
1 total messages
Started by kavya01sha
Thu, 26 Mar 2009 07:55
Indesign
Author: kavya01sha
Date: Thu, 26 Mar 2009 07:55
Date: Thu, 26 Mar 2009 07:55
67 lines
2686 bytes
2686 bytes
Hi All,
I have designed a script. It invokes a form with textboxes and some buttons.
1. If I click a button it has to add a template to the indesign. I have tried this. But when the form is open I am not able to do this.
2. How to run a batch file by pressing a button?
3. How to temporarily destroy a form?
I have pasted the code below for your reference.
var myDlg = new Window('dialog', 'XML InDesign Workflow',[100,100,800,600]);
myDlg.tempSt = myDlg.add('statictext', [15,15,105,45], 'Template File:');
myDlg.tempEt = myDlg.add('edittext', [115,15,550,45], ' ');
myDlg.tempBtn = myDlg.add('button', [560,15,620,45],'Browse', {name:'bro'});
myDlg.ruleSt = myDlg.add('statictext', [15,55,105,85], 'Rule File:');
myDlg.ruleEt = myDlg.add('edittext', [115,55,550,85], ' ');
myDlg.ruleBtn = myDlg.add('button', [560,55,620,85],'Browse', {name:'brow'});
myDlg.xmlSt = myDlg.add('statictext', [15,95,105,125], 'XML File:');
myDlg.xmlEt = myDlg.add('edittext', [115,95,550,125], ' ');
myDlg.xmlBtn = myDlg.add('button', [560,95,620,125],'Browse', {name:'brows'});
myDlg.msgEt = myDlg.add('edittext', [115,145,550,425], ' ', {multiline:true});
myDlg.impBtn = myDlg.add('button', [115,445,205,475],'Import', {name:'imp'});
myDlg.expBtn = myDlg.add('button', [280,445,375,475], 'Export', {name:'exp'});
myDlg.cancelBtn = myDlg.add('button', [460,445,555,475], 'Cancel', {name:'cancel'});
myDlg.tempBtn.onClick = function()
{
var selectedfile = File.openDialog("Choose template file", "*.indd", false);
if (selectedfile != null) {
myDlg.tempEt.text = selectedfile.fsName;
}
}
myDlg.ruleBtn.onClick = function()
{
var selectedfile = File.openDialog("Choose rule file", "*.xml", false);
if (selectedfile != null) {
myDlg.ruleEt.text = selectedfile.fsName;
}
}
myDlg.xmlBtn.onClick = function()
{
var selectedfile = File.openDialog("Choose XML file", "*.xml", false);
if (selectedfile != null) {
myDlg.xmlEt.text = selectedfile.fsName;
}
}
myDlg.impBtn.onClick = function()
{
var myDocument = app.documents.add()
}
myDlg.cancelBtn.onClick = function()
{
myDlg.close()
}
myDlg.show();
Thanks
kavya
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads