Script doesn't get TextFrames.text

Explorer ,
Dec 08, 2021 Dec 08, 2021

Copy link to clipboard

Copied

Hello everyone,

 

I wrote a script with UI to quickly insert title block information to my Illustrator file.
The script instantly gets the Text from the editboxes if only 7 arguments are defined.

But if I want to work with all the arguments, the script doesn't work anymore.
Here is a Link to a Sample AI with titleblock:
https://assets.adobe.com/id/urn:aaid:sc:EU:c63a7ba9-7ce8-4347-963d-5949f584427c?view=difile 

After some testing, this part results in problems:

 

function get_prop(){
    odesigner.contents = Designer.text;
    ocreationdate.contents = Datum.text;
    otitle.contents = Titel.text;
    opartnumber.contents = Artikelnummer.text;
    orev.contents = Revision.text;
    omodby.contents=modified_by.text;
    omoddate.contents=modified_date.text;
    oapprby.contents=approved_by.text;
    oapprdate.contents=approved_date.text;
    overiby.contents=verified_by.text;
    overidate.contents=verified_date.text;
 }

 

 

Following the full codes.

Working code:

 

    var odesigner = app.activeDocument.textFrames.getByName ("designer");
    var ocreationdate = app.activeDocument.textFrames.getByName ("date_of_creation");
    var otitle = app.activeDocument.textFrames.getByName ("Titel") ;
    var opartnumber = app.activeDocument.textFrames.getByName ("partnumber") ;
    var orev = app.activeDocument.textFrames.getByName ("Revision");
    var omodby=app.activeDocument.textFrames.getByName ("modified_by");
    var omoddate=app.activeDocument.textFrames.getByName ("modified_date");
    var oapprby=app.activeDocument.textFrames.getByName ("approved_by");
    var oapprdate=app.activeDocument.textFrames.getByName ("approved_date");
    var overiby=app.activeDocument.textFrames.getByName ("verified_by");
    var overidate=app.activeDocument.textFrames.getByName ("verified_date");
   
    
    function today_date(){
        var dd = todaydate.getDate();
    
        var mm = todaydate.getMonth()+1; //January is 0!
    
        var yyyy = todaydate.getFullYear();
    
        if(dd<10) {
    
            dd = '0'+dd
    
        }
    
        if(mm<10) {
    
            mm = '0'+mm
    
        }
    
        todaydate= dd + '.' + mm + '.' + yyyy;
    }
    

    var w = new Window ("dialog", "Titelblock Eingabe"); {
    
        w.orientation = "column";
 
       
    
       
        var groupgen = w.add("group",undefined,''); 
            groupgen.alignChildren = "fill"; 
            groupgen.orientation = "row";
    
                     
        var group1 = groupgen.add("panel",undefined, "Erstellung"); 
            group1.orentation = "column"; 
            group1.alignChildren = "fill";     
    
    
        var group2 = groupgen.add("panel",undefined, "Nummerierung"); 
            group2.orentation = "column"; 
            group2.alignChildren = "fill";
    
        var todaydate = new Date();
    
        today_date();
    
    
        var myDesigner = group1.add ("Panel", undefined, "Designer:"); {
            myDesigner.alignChildren = "fill";
            myDesigner.orientation      ="row";
            var Designer= myDesigner.add ("edittext", undefined, odesigner.contents);
                Designer.preferredSize = [250,23];
        }
    
        var myDate = group1.add ("Panel", undefined, "Erstellungsdatum"); {
            myDate.alignChildren = "fill";
            myDate.orientation      ="row";
            var Datum= myDate.add ("edittext", undefined, ocreationdate.contents);
                Datum.preferredSize = [250,23];
            var Datebtn=myDate.add ("button", undefined, "Heute");
                Datebtn.onClick=function(){Datum.text=todaydate;
                        }
            }
    
       var mymodified_by = group1.add ("panel", undefined, "Modified by:");
            mymodified_by.alignChildren = "fill";
            mymodified_by.orientation      ="column";
            var modified_by= mymodified_by.add ("edittext", undefined, omodby.contents);
                modified_by.preferredSize = [250,23];
                
                
       var mymodified_date = group1.add ("panel", undefined, "Modified date:");
            mymodified_date.alignChildren = "fill";
            mymodified_date.orientation      ="row";
            var modified_date= mymodified_date.add ("edittext", undefined, omoddate.contents);
                modified_date.preferredSize = [250,23];           
            var modbtn=mymodified_date.add ("button", undefined, "Heute");
                modbtn.onClick=function(){modified_date.text=todaydate;
                        }
            
        
      var myveri = group1.add ("panel", undefined, "Verified:");
            myveri.alignChildren = "fill";
            myveri.orientation      ="row";
            var veribyst    = myveri.add ("statictext", undefined, "By");
            var verified_by= myveri.add ("edittext", undefined, overiby.contents);
                verified_by.preferredSize = [125,23];    
            var verified_date= myveri.add ("edittext", undefined, overidate.contents);
                verified_date.preferredSize = [125,23];       
    
    
        var myappr =group1.add ("panel", undefined, "Approve:");
            myappr.alignChildren="fill"
            myappr.orientation = "row"       
            var apprby =myappr.add("edittext",undefined,oapprby.contents);
            var apprdate=myappr.add("edittext",undefined,oapprdate.contents);
    
    
        var myTitel = group2.add ("panel", undefined, "Titel:");
            myDesigner.alignChildren = "fill";
            myDesigner.orientation      ="column";
            var Titel= myTitel.add ("edittext", undefined, otitle.contents);
                Titel.preferredSize = [250,23];
               
    
        var myArtikelnummer = group2.add ("panel", undefined, "Artikelnummer:");
            myArtikelnummer.alignChildren = "fill";
            myArtikelnummer.orientation      ="column";
            var Artikelnummer= myArtikelnummer.add ("edittext", undefined, opartnumber.contents);
                Artikelnummer.preferredSize = [250,23];     
                
                
        var myIndex = group2.add ("panel", undefined, "Index:");
            myIndex.alignChildren = "fill";
            myIndex.orientation      ="row";
            var Revision= myIndex.add ("edittext", undefined, orev.contents);
                Revision.preferredSize = [25,23];              
    
               
    
        var myButtongroup = w.add("group");
            myButtongroup.alignment ="center";
            var okbtn=    myButtongroup.add ("button", undefined, "OK");
                okbtn.onClick=function(){get_prop()
                 w.close()};
             
            var applybtn=    myButtongroup.add ("button", undefined, "Apply");
                applybtn.onClick=function(){get_prop()
                    redraw();}       
            
            var cancelbtn = myButtongroup.add ("button", undefined, "Cancel");
    
    
        w.show ();
    
    }
    function get_prop(){
   odesigner.contents = Designer.text;
    ocreationdate.contents = Datum.text;
    otitle.contents = Titel.text;
    opartnumber.contents = Artikelnummer.text;
    orev.contents = Revision.text;
    omodby.contents=modified_by.text;
    omoddate.contents=modified_date.text;
  
    
    
    }
    redraw();
    
    
    var main_folder_path = "C:/Users/" +$.getenv("USERNAME")+ "/Desktop/AR-Nummern Ablage/" + Artikelnummer.text.slice(0, 7) + "xxx" + "/" + Artikelnummer.text + "/"
    
    var einkauf_folder_path = main_folder_path + "Einkauf" + "/"
    
    var archiv_folder_path = einkauf_folder_path + "Archiv" + "/"
    var archiv_rev_folder_path = archiv_folder_path + Revision.text + "/"
    var fertigung_folder_path = einkauf_folder_path + "Fertigung" + "/" 
    var fertigungsdaten_folder_path = fertigung_folder_path + "Fertigungsdaten" + "/"
    
    var main_folder = new Folder (main_folder_path );
    var einkauf_folder = new Folder (einkauf_folder_path);
    var archiv_folder = new Folder (archiv_folder_path);
    var archiv_ref_folder = new Folder (archiv_rev_folder_path);
    var fertigung_folder = new Folder (fertigung_folder_path);
    var fertigungsdaten_folder = new Folder (fertigungsdaten_folder_path);
    
    einkauf_folder.create();
    fertigung_folder.create();
    fertigungsdaten_folder.create();
    archiv_folder.create();
    archiv_ref_folder.create();
    
    
    
    var doc = app.activeDocument; // Name of the active document 
    
    var original_file = doc.fullName; // we need to store the original file and path 
    
    var pdfOption = 'Adobe PDF-Vorgabe 1'; // Name of PDF settings  
    
    var pdfSuff = '.pdf'; // Suffix for PDF 
    
    var arr = doc.name.split("."); 
    
    var extension = ""; 
    
        if (arr.length>1) extension = "." + arr.pop(); 
    
            var filename = arr.join("."); // Just generate a clean file name 
    
            var name_pdfpreview = Artikelnummer.text + pdfSuff; // new name and suffix for PDF 
    
            //var export_folder = new  Folder ("C:/Users/fvo/Desktop/AR-Nummern Ablage/" + Artikelnummer.text.slice(0, 5) + "/" ); // Define path where to save PDF 
    
            //if (!export_folder.exists)
    
            //  export_folder .create();
    
    
    
    // Exports current document to dest as a JPEG file with specified options,
    // dest contains the full path including the file name
       var jpg_dest = fertigungsdaten_folder_path +Artikelnummer.text + '.jpg';
       var jpg_dest_archiv = archiv_rev_folder_path + Artikelnummer.text + "-" + Revision.text + '.jpg';
    
    function exportFileToJPEG() {
     
        if (app.documents.length > 0) {
          var jpgexportOptions = new ExportOptionsJPEG();
            jpgexportOptions.antiAliasing = false;
            jpgexportOptions.qualitySetting = 70;
            jpgexportOptions.artBoardClipping = true;
            jpgexportOptions.optimization = true;  
            jpgexportOptions.ver
    
          var jpgtype = ExportType.JPEG;
          var fileSpec = new File(jpg_dest);
      
          app.activeDocument.exportFile(fileSpec, jpgtype, jpgexportOptions);
          
        } 
    }
    
    exportFileToJPEG(jpg_dest);
    exportFileToJPEG(jpg_dest_archiv);
    
    // Exports current document to dest as a JPEG file with specified options,
    // dest contains the full path including the file name
    
    png_dest=fertigungsdaten_folder_path +Artikelnummer.text + '.png' ;
    function exportFileToPNG8(png_dest) {
        if (app.documents.length > 0) {
          var exportOptions = new ExportOptionsPNG8();
          exportOptions.colorCount = 8;
          exportOptions.transparency = false;
      
          var type = ExportType.PNG8;
          var fileSpec = new File(png_dest);
      
          app.activeDocument.exportFile(fileSpec, type, exportOptions);
        }
      }
    
    
    // save as PDF and tell function which options to use and how to name the PDF 
    
    function saveCopyAsPDF (setPDF, namePDF) { 
    
            var destFolder = null; 
    
                destFolder = fertigungsdaten_folder_path; 
    
            var destFolderArchiv = null;
            
                destFolderArchiv = archiv_rev_folder_path + Artikelnummer.text + "-" + Revision.text + '.pdf';
    
            var options = null;     
    
                options = new PDFSaveOptions (); 
    
                options.PDFPreset = setPDF; 
    
                options.viewAfterSaving = false; // just to be sure not to open Acrobat 
    
            var targetFile = null; 
    
                targetFile = new File (destFolder + "/" + namePDF);     
                
                var targetArchiv = null,
                targetArchiv = new File (destFolderArchiv);
    
            doc.saveAs (targetFile, options); // here we save the PDF  
            doc.saveAs (targetArchiv, options);
    
      //  doc.close (); // now we close it in Illustrator ... 
    
      // app.open (File (original_file)); // ... and re-open the Illustrator file 
       
    } 
    
      saveCopyAsPDF (pdfOption, name_pdfpreview);
       
     
    
    
    

 

 Not working code:

 

 

 var odesigner = app.activeDocument.textFrames.getByName ("designer");
 var ocreationdate = app.activeDocument.textFrames.getByName ("date_of_creation");
 var otitle = app.activeDocument.textFrames.getByName ("Titel") ;
 var opartnumber = app.activeDocument.textFrames.getByName ("partnumber") ;
 var orev = app.activeDocument.textFrames.getByName ("Revision");
 var omodby=app.activeDocument.textFrames.getByName ("modified_by");
 var omoddate=app.activeDocument.textFrames.getByName ("modified_date");
 var oapprby=app.activeDocument.textFrames.getByName ("approved_by");
 var oapprdate=app.activeDocument.textFrames.getByName ("approved_date");
 var overiby=app.activeDocument.textFrames.getByName ("verified_by");
 var overidate=app.activeDocument.textFrames.getByName ("verified_date");   
   
    function today_date(){
        var dd = todaydate.getDate();
    
        var mm = todaydate.getMonth()+1; //January is 0!
    
        var yyyy = todaydate.getFullYear();
    
        if(dd<10) {
    
            dd = '0'+dd
    
        }
    
        if(mm<10) {
    
            mm = '0'+mm
    
        }
    
        todaydate= dd + '.' + mm + '.' + yyyy;
    }

 function backup_prop(){
     bak_designer+=odesigner.contents;
 }


     
    var w = new Window ("dialog", "Titelblock Eingabe"); {
    
        w.orientation = "column";

       

        var groupgen = w.add("group",undefined,''); 
            groupgen.alignChildren = "fill"; 
            groupgen.orientation = "row";
    
                     
        var group1 = groupgen.add("panel",undefined, "Erstellung"); 
            group1.orentation = "column"; 
            group1.alignChildren = "fill";     
    
    
        var group2 = groupgen.add("panel",undefined, "Nummerierung"); 
            group2.orentation = "column"; 
            group2.alignChildren = "fill";
    
        var todaydate = new Date();
    
        today_date();
    
    
        var myDesigner = group1.add ("Panel", undefined, "Designer:"); {
            myDesigner.alignChildren = "fill";
            myDesigner.orientation      ="row";
            var Designer= myDesigner.add ("edittext", undefined, odesigner.contents);
                Designer.preferredSize = [250,23];
        }
    
        var myDate = group1.add ("Panel", undefined, "Erstellungsdatum"); {
            myDate.alignChildren = "fill";
            myDate.orientation      ="row";
            var Datum= myDate.add ("edittext", undefined, ocreationdate.contents);
                Datum.preferredSize = [250,23];
            var Datebtn=myDate.add ("button", undefined, "Heute");
                Datebtn.onClick=function(){Datum.text=todaydate;
                        }
            }
    
       var mymodified_by = group1.add ("panel", undefined, "Modified by:");
            mymodified_by.alignChildren = "fill";
            mymodified_by.orientation      ="column";
            var modified_by= mymodified_by.add ("edittext", undefined, omodby.contents);
                modified_by.preferredSize = [250,23];
                
                
       var mymodified_date = group1.add ("panel", undefined, "Modified date:");
            mymodified_date.alignChildren = "fill";
            mymodified_date.orientation      ="row";
            var modified_date= mymodified_date.add ("edittext", undefined, omoddate.contents);
                modified_date.preferredSize = [250,23];           
            var modbtn=mymodified_date.add ("button", undefined, "Heute");
                modbtn.onClick=function(){modified_date.text=todaydate;
                        }
            
        
      var myveri = group1.add ("panel", undefined, "Verified:");
            myveri.alignChildren = "fill";
            myveri.orientation      ="row";
        //    var veribyst    = myveri.add ("statictext", undefined, "By");
            var verified_by= myveri.add ("edittext", undefined, overiby.contents);
                verified_by.preferredSize = [125,23];    
            var verified_date= myveri.add ("edittext", undefined, overidate.contents);
                verified_date.preferredSize = [125,23];
            var veribtn   = myveri.add ("button",undefined,"Heute");
                veribtn.onClick=function(){verified_date.text=todaydate;}



    
        var myTitel = group2.add ("panel", undefined, "Titel:");
            myDesigner.alignChildren = "fill";
            myDesigner.orientation      ="column";
            var Titel= myTitel.add ("edittext", undefined, otitle.contents);
                Titel.preferredSize = [250,23];
               
    
        var myArtikelnummer = group2.add ("panel", undefined, "Artikelnummer:");
            myArtikelnummer.alignChildren = "fill";
            myArtikelnummer.orientation      ="column";
            var Artikelnummer= myArtikelnummer.add ("edittext", undefined, opartnumber.contents);
                Artikelnummer.preferredSize = [250,23];     
                
                
        var myIndex = group2.add ("panel", undefined, "Index:");
            myIndex.alignChildren = "fill";
            myIndex.orientation      ="row";
            var Revision= myIndex.add ("edittext", undefined, orev.contents);
                Revision.preferredSize = [25,23];              
    
 
            
    
        var myButtongroup = w.add("group");
            myButtongroup.alignment ="center";
            var okbtn=    myButtongroup.add ("button", undefined, "OK");
                okbtn.onClick=function(){get_prop()
          
                main();
                w.close()};
             
                var applybtn=    myButtongroup.add ("button", undefined, "Apply");
                applybtn.onClick=function(){get_prop()
                
               


                    redraw();}       
            
            var cancelbtn = myButtongroup.add ("button", undefined, "Cancel");
                cancelbtn.onClick = function() {
                    
                    backup_prop();
                    w.close ();
                };
              
        w.show ();
    }  
 
        function get_prop(){
     odesigner.contents = Designer.text;
    ocreationdate.contents = Datum.text;
    otitle.contents = Titel.text;
    opartnumber.contents = Artikelnummer.text;
    orev.contents = Revision.text;
    omodby.contents=modified_by.text;
    omoddate.contents=modified_date.text;
    oapprby.contents=approved_by.text;
    oapprdate.contents=approved_date.text;
    overiby.contents=verified_by.text;
    overidate.contents=verified_date.text;
 
        }

    redraw();
    
    function main(){
    var main_folder_path = "C:/Users/" +$.getenv("USERNAME")+ "/Desktop/AR-Nummern Ablage/" + Artikelnummer.text.slice(0, 7) + "xxx" + "/" + Artikelnummer.text + "/"
    
    var einkauf_folder_path = main_folder_path + "Einkauf" + "/"
    
    var archiv_folder_path = einkauf_folder_path + "Archiv" + "/"
    var archiv_rev_folder_path = archiv_folder_path + Revision.text + "/"
    var fertigung_folder_path = einkauf_folder_path + "Fertigung" + "/" 
    var fertigungsdaten_folder_path = fertigung_folder_path + "Fertigungsdaten" + "/"
    
    var main_folder = new Folder (main_folder_path );
    var einkauf_folder = new Folder (einkauf_folder_path);
    var archiv_folder = new Folder (archiv_folder_path);
    var archiv_ref_folder = new Folder (archiv_rev_folder_path);
    var fertigung_folder = new Folder (fertigung_folder_path);
    var fertigungsdaten_folder = new Folder (fertigungsdaten_folder_path);
    
    einkauf_folder.create();
    fertigung_folder.create();
    fertigungsdaten_folder.create();
    archiv_folder.create();
    archiv_ref_folder.create();
    
    
    
    var doc = app.activeDocument; // Name of the active document 
    
    var original_file = doc.fullName; // we need to store the original file and path 
    
    var pdfOption = 'Adobe PDF-Vorgabe 1'; // Name of PDF settings  
    
    var pdfSuff = '.pdf'; // Suffix for PDF 
    
    var arr = doc.name.split("."); 
    
    var extension = ""; 
    
        if (arr.length>1) extension = "." + arr.pop(); 
    
            var filename = arr.join("."); // Just generate a clean file name 
    
            var name_pdfpreview = Artikelnummer.text + pdfSuff; // new name and suffix for PDF 
    
            //var export_folder = new  Folder ("C:/Users/fvo/Desktop/AR-Nummern Ablage/" + Artikelnummer.text.slice(0, 5) + "/" ); // Define path where to save PDF 
    
            //if (!export_folder.exists)
    
            //  export_folder .create();
    
    
    
    // Exports current document to dest as a JPEG file with specified options,
    // dest contains the full path including the file name
       var jpg_dest = fertigungsdaten_folder_path +Artikelnummer.text + '.jpg';
       var jpg_dest_archiv = archiv_rev_folder_path + Artikelnummer.text + "-" + Revision.text + '.jpg';
    
    function exportFileToJPEG() {
     
        if (app.documents.length > 0) {
          var jpgexportOptions = new ExportOptionsJPEG();
            jpgexportOptions.antiAliasing = false;
            jpgexportOptions.qualitySetting = 70;
            jpgexportOptions.artBoardClipping = true;
            jpgexportOptions.optimization = true;  
            jpgexportOptions.ver
    
          var jpgtype = ExportType.JPEG;
          var fileSpec = new File(jpg_dest);
      
          app.activeDocument.exportFile(fileSpec, jpgtype, jpgexportOptions);
          
        } 
    }
    
    exportFileToJPEG(jpg_dest);
    exportFileToJPEG(jpg_dest_archiv);
    
    // Exports current document to dest as a JPEG file with specified options,
    // dest contains the full path including the file name
    
    png_dest=fertigungsdaten_folder_path +Artikelnummer.text + '.png' ;
    function exportFileToPNG8(png_dest) {
        if (app.documents.length > 0) {
          var exportOptions = new ExportOptionsPNG8();
          exportOptions.colorCount = 8;
          exportOptions.transparency = false;
      
          var type = ExportType.PNG8;
          var fileSpec = new File(png_dest);
      
          app.activeDocument.exportFile(fileSpec, type, exportOptions);
        }
      }
    
    
    // save as PDF and tell function which options to use and how to name the PDF 
    
    function saveCopyAsPDF (setPDF, namePDF) { 
    
            var destFolder = null; 
    
                destFolder = fertigungsdaten_folder_path; 
    
            var destFolderArchiv = null;
            
                destFolderArchiv = archiv_rev_folder_path + Artikelnummer.text + "-" + Revision.text + '.pdf';
    
            var options = null;     
    
                options = new PDFSaveOptions (); 
    
                options.PDFPreset = setPDF; 
    
                options.viewAfterSaving = false; // just to be sure not to open Acrobat 
    
            var targetFile = null; 
    
                targetFile = new File (destFolder + "/" + namePDF);     
                
                var targetArchiv = null,
                targetArchiv = new File (destFolderArchiv);
    
            doc.saveAs (targetFile, options); // here we save the PDF  
            doc.saveAs (targetArchiv, options);
    
      //  doc.close (); // now we close it in Illustrator ... 
    
      // app.open (File (original_file)); // ... and re-open the Illustrator file 
       
    } 
    
      saveCopyAsPDF (pdfOption, name_pdfpreview);
       
     
}  
    
    

 

 

My idea was to handle those textframes with an array, but I am unsure how to do this.
Maybe someone has a better idea or a clue what I am doing wrong.

Thank you in advance.

 

Frederik

TOPICS
Scripting

Views

109

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Dec 08, 2021 Dec 08, 2021
... I am stupid... In the get_prop function was refering to the textframe.text...not the editbox text.oaprby.contents=myapprby.text; oaprdate.contents=myapprdate.text; Here is the change that made it working. Sry

Likes

Translate

Translate
Advocate ,
Dec 08, 2021 Dec 08, 2021

Copy link to clipboard

Copied

When you say "7 arguments" and "all arguments", what are the arguments you refer to and what is the function these arguments are passed to?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 08, 2021 Dec 08, 2021

Copy link to clipboard

Copied

Sry, to be more clear, this is part of the working code:

    function get_prop(){
    odesigner.contents = Designer.text;
    ocreationdate.contents = Datum.text;
    otitle.contents = Titel.text;
    opartnumber.contents = Artikelnummer.text;
    orev.contents = Revision.text;
    omodby.contents=modified_by.text;
    omoddate.contents=modified_date.text;
  
    
    
    };

This is the not working part:

        function get_prop(){
     odesigner.contents = Designer.text;
    ocreationdate.contents = Datum.text;
    otitle.contents = Titel.text;
    opartnumber.contents = Artikelnummer.text;
    orev.contents = Revision.text;
    omodby.contents=modified_by.text;
    omoddate.contents=modified_date.text;
    oapprby.contents=approved_by.text;
    oapprdate.contents=approved_date.text;
    overiby.contents=verified_by.text;
    overidate.contents=verified_date.text;
 
        };

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 08, 2021 Dec 08, 2021

Copy link to clipboard

Copied

In sample of the Designer property:

I define the variable first:

var odesigner = app.activeDocument.textFrames.getByName ("designer");


then the UI fires, with checking the values from the AI and I insert the value in an editbox

        var myDesigner = group1.add ("Panel", undefined, "Designer:"); {
            myDesigner.alignChildren = "fill";
            myDesigner.orientation      ="row";
            var Designer= myDesigner.add ("edittext", undefined, odesigner.contents);
                Designer.preferredSize = [250,23];
        }

The values inside the editbox are then applied to the AI with apply or OK button

var applybtn=    myButtongroup.add ("button", undefined, "Apply");
                applybtn.onClick=function(){get_prop()

                    redraw();} 


With this function

        function get_prop(){
     odesigner.contents = Designer.text;
/*    ocreationdate.contents = Datum.text;
    otitle.contents = Titel.text;
    opartnumber.contents = Artikelnummer.text;
    orev.contents = Revision.text;
    omodby.contents=modified_by.text;
    omoddate.contents=modified_date.text;
    oapprby.contents=approved_by.text;
    oapprdate.contents=approved_date.text;
    overiby.contents=verified_by.text;
    overidate.contents=verified_date.text;
*/ 
        };



Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 08, 2021 Dec 08, 2021

Copy link to clipboard

Copied

... I am stupid...

In the get_prop function was refering to the textframe.text...not the editbox text.

oaprby.contents=myapprby.text;
oaprdate.contents=myapprdate.text;

 

Here is the change that made it working. Sry

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Dec 08, 2021 Dec 08, 2021

Copy link to clipboard

Copied

I don't think you are stupid, typos, oversights, object mix up is pretty common, it happens to everyone I would say

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 08, 2021 Dec 08, 2021

Copy link to clipboard

Copied

LATEST

All's well that ends well.  

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines