🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #322

Indesign

#322
From: kavya01sha
Date: Thu, 26 Mar 2009 07:55
67 lines
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
Technical Details
Message-ID: <59b869be.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,7fc53af2d7051e55,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: kavya01sha@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Indesign
Message-ID: <59b869be.-1@webcrossing.la2eafNXanI>
Date: Thu, 26 Mar 2009 00:55:15 -0700
Lines: 81
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit