Hi,
I have dialog script that I am using in InDesign to choose a pdf file to place into the document and I need exactly the same script in Illustrator, but I have a hard time to translate it into Illustrator scripting format. I don't have much information about building dialogs in Illustrator. Could someone help me.
var myDialog = app.dialogs.add({name:"Holiday Templates",
canCancel:true});
with(myDialog){
//Add a dialog column.
with(dialogColumns.add()){
//Add a dialog column.
with(dialogColumns.add()){
// Radius radio buttons //
with(borderPanels.add()){
staticTexts.add({staticLabel:"Choose Holiday Template:"});
var myRadioButtonGroup = radiobuttonGroups.add();
with(myRadioButtonGroup){
var myEighthRadius = radiobuttonControls.add
({staticLabel:"4x6_flower", checkedState:true});
var myQuaterRadius = radiobuttonControls.add
({staticLabel:"4x6_heart"});
}
}
}
var myResult = myDialog.show();
if(myResult == true){
var myFolderPath = myPath + "/~prepress/HolidayTemplatesFilePrep/";
// Radio buttons readings //
if(myRadioButtonGroup.selectedButton == 0){
myTemplateA = File (myFolderPath + "/~4x6_flower.pdf");
myTemplate2A = File (myFolderPath + "~4x6_flower_back.pdf");
}
else if(myRadioButtonGroup.selectedButton == 1){
myTemplateA = File (myFolderPath + "/~4x6_heart.pdf");
myTemplate2A = File (myFolderPath + "/~4x6_heart_back.pdf");
}
myDialog.destroy();
myHolidayTemplates();
}
else{
myDialog.destroy();
}
}
}
Thank you very much for your help.
Yulia