File Name Stamper

Hello All,
I am using: http://acrobatusers.com/assets/uploads/actions/File_Name_Stamper.pdf
It works great for one file. But for multiple files, a popup dialog box keeps showing up. Our small non-profit organization is processing 1000+ files and pressing the enter key is cumbersome.
The actual JavaScript code is below. Is there a way to disable the popup dialog box?
Many thanks...
//   File Name Stamper Action Script
//   by Thom Parker, WindJack Solutions, Inc.
//      www.windjack.com, www.pdfscripting.com
//   for Adobe Systems Inc. www.adobe.com
//       NOTE: Only for use in an Action Script
//       Requires:  Acrobat 10 or later
//   Stamps the PDF file Name/Title/Date onto a PDF
//   A popup dialog for entering stamping parameters
//   is displayed for each PDF processed by the Action
//   Parameters include Position, Text Size, Font, Text Color
//   The stamp is created watermark
//   Version 1.2 - 11/5/2020
//Acrobat JavaScript Dialog
//Created by DialogDesigner from WindJack Solutions
//<CodeAbove>
var aFontNames = [
"Helvetica",
"Times",
"Courier",
var aDateFmts = [
            "mm/dd/yyyy",
            "yyyy-mm-dd",
            "mmmm d, yyyy",
            "ddd mmm d, yyyy",
            "dddd mmmm d, yyyy"
function SetLabelText(dialog, dlg)
     var strLab = "";
     var oRslt = dialog.store();
     strLab = oRslt["FlNm"]?dlg.strDocFileName:dlg.strDocTitle;
     if(oRslt["HDat"])
        var path = new Array();
         strLab += " - " + ( (dlg.GetListSel(oRslt["DFmt"],path))?path.reverse():"").toString();
     dialog.load({"DcSt":strLab});
//</CodeAbove>
if(typeof(global.FileNameStamp) == "undefined")
global.FileNameStamp =
    result:"cancel",
    DoDialog: function(){return app.execDialog(this);},
    strLabSource:"FlNm",
    strDocStamp:"",
    bUseDate:false,
    strDateFormat:"",
    strFontName:["Helvetica"],
    strFontSize:"12",
    strFontColor:"000000",
    strHorzPos:"PosR",
    nMarginX:"0.5",
    strVertPos:"PosT",
    nMarginY:"0.5",
    strPgRangeSel:"rAll",
    strStrtPg:"",
    strEndPg:"",
    GetRadioSel:function(oRslts,aCtrls){
      for(var strRtn=aCtrls[0];aCtrls.length>0;strRtn=aCtrls.pop()){
        if(oRslts[strRtn] == true)
          return strRtn;
      return "";
    SetListSel:function(list,path){if(path.length == 0) return;
    eval("list[\""+ ((typeof path.join != "function")?path:path.join("\"][\"")) + "\"] = 1")},
    GetListSel:function(oLstRslts,path){
       for(var item in oLstRslts){
          if( ((typeof oLstRslts[item]=="number")&&(oLstRslts[item]>0))
             || this.GetListSel(oLstRslts[item],path) )
           {path.push(item);return true;}
       return false;
    bHidden:true,
    nNumPages:1,
    nCurPage:0,
    strDocTitle:"My Title",
    strDocFileName:"mytestdoc.pdf",
    SetTheLabel:SetLabelText,
    initialize: function(dialog)
        var listDFmt = new Object();
        this.SetListSel(listDFmt, this.strDateFormat);
        var listFont =
            "Helvetica": -1,
        this.SetListSel(listFont, this.strFontName);
        var dlgInit =
            "Font": listFont,
            "FtSz": this.strFontSize,
            "FtCl": this.strFontColor,
            "MrgH": this.nMarginX,
            "MrgV": this.nMarginY,
                "DcSt": this.strDocStamp,
                "HDat": this.bUseDate,
                "tFPg": this.strStrtPg,
                "tTPg": this.strEndPg,
        dlgInit[this.strLabSource] = true;
        dlgInit[this.strHorzPos] = true;
        dlgInit[this.strVertPos] = true;
        dlgInit[this.strPgRangeSel] = true;
        dialog.load(dlgInit);
        dialog.enable(
                "tTPg": false,
                "tFPg": false,
                "DFmt": false,
        if( (this.strStrtPg == "")|| isNaN(this.strStrtPg) || (Number(this.strStrtPg) > this.nNumPages) )
           if(this.bHidden)
               this.strStrtPg = "1";
           else
               this.strStrtPg = (this.nCurPage+1).toString();
        if((this.strEndPg == "") || isNaN(this.strEndPg) || (Number(this.strEndPg) > this.nNumPages) )
           this.strEndPg = this.nNumPages.toString();
        var flist = {};
        for(var i=0;i<aFontNames.length;i++)
        for(var nm in font)
           flist[font[nm]] = -1;
        flist[this.strFontName] = 1;
        var dlist = {};
        var oDt = new Date();
        for(var i=0;i<aDateFmts.length;i++)
           dlist[util.printd(aDateFmts[i],oDt)] = (i==0)?1:-1;
        var exInit ={"tFPg": this.strStrtPg,"tTPg":this.strEndPg, "sOfN":"of (" + this.nNumPages+")",
                             "DcSt":(this.strLabSource == "FlNm")?this.strDocFileName:this.strDocTitle,
                             "TopL":"Working on File: " + this.strDocFileName, "Font":flist, "DFmt":dlist };
        if(this.bHidden && this.strPgRangeSel == "rCur")
              this.strPgRangeSel = "rAll";
              exInit["rCur"] = false;
              exInit[this.strPgRangeSel] = true;
        dialog.load(exInit);
        var exInit = {"ExPg":this.strPgRangeSel =="rFro", "MrgH":this.strHorzPos!="PosC", "MrgV":this.strVertPos!="PosM",
                                "tFPg":this.strPgRangeSel =="rFro", "tTPg":this.strPgRangeSel == "rFro", "rCur":!this.bHidden,
                                "DcSt":(this.strLabSource == "Titl"), "DFmt":this.bUseDate};
        dialog.enable(exInit);
        this.SetTheLabel(dialog,this);
    validate: function(dialog)
        var oRslt = dialog.store();
        if(isNaN(oRslt["FtSz"]) || (Number(oRslt["FtSz"]) < 0))
             app.alert("Font Size must be a positive number");
             return false;
        var rg = /([\dabcdef]{2})([\dabcdef]{2})([\dabcdef]{2})/i;
        if(!rg.test(oRslt["FtCl"]))
             app.alert("The Font Color must be a series of 3 pairs of Hexadecimal numbers,"
                           + " where each pair represents one 8 bit color component, Red Green Blue\n"
                           + "For Example:\n   Black = 000000,  Red = FF0000, Green = 00FF00, Blue = 0000FF");
             return false;
        if(isNaN(oRslt["MrgH"]) || (Number(oRslt["MrgH"]) < 0))
             app.alert("The Horizontal Margin must be a positive number");
             return false;
        if(isNaN(oRslt["MrgV"]) || (Number(oRslt["MrgV"]) < 0))
             app.alert("The Vertical Margin must be a positive number");
             return false;
        return true;
    commit: function(dialog)
        var oRslt = dialog.store();
        this.strLabSource = this.GetRadioSel(oRslt,["FlNm","Titl"]);
        this.strDocStamp = oRslt["DcSt"];
        this.bUseDate = oRslt["HDat"];
        var path = new Array();
        this.strDateFormat = (this.GetListSel(oRslt["DFmt"],path))?path.reverse():"";
        var path = new Array();
        this.strFontName = (this.GetListSel(oRslt["Font"],path))?path.reverse():"";
        this.strFontSize = oRslt["FtSz"];
        this.strFontColor = oRslt["FtCl"];
        this.strHorzPos = this.GetRadioSel(oRslt,["PosL","PosC","PosR"]);
        this.nMarginX = oRslt["MrgH"];
        this.strVertPos = this.GetRadioSel(oRslt,["PosT","PosM","PosB"]);
        this.nMarginY = oRslt["MrgV"];
        this.strPgRangeSel = this.GetRadioSel(oRslt,["rAll","rCur","rFro"]);
        this.strStrtPg = oRslt["tFPg"];
        this.strEndPg = oRslt["tTPg"];
    "But1": function(dialog)
        dialog.end("Abrt");
    "tTPg": function(dialog)
        var x;
    "rFro": function(dialog)
        dialog.enable({tFPg:true, tTPg:true, "ExPg":true});
    "rCur": function(dialog)
        dialog.enable({tFPg:false, tTPg:false,"ExPg":false});
    "rAll": function(dialog)
        dialog.enable({tFPg:false, tTPg:false, "ExPg":false});
    "PosB": function(dialog)
        dialog.enable({"MrgV":true});
    "PosM": function(dialog)
        dialog.enable({"MrgV":false});
    "PosT": function(dialog)
        dialog.enable({"MrgV":true});
    "PosR": function(dialog)
        dialog.enable({"MrgH":true});
    "PosC": function(dialog)
        dialog.enable({"MrgH":false});
    "PosL": function(dialog)
        dialog.enable({"MrgH":true});
    "DFmt": function(dialog)
        this.SetTheLabel(dialog,this);
    "HDat": function(dialog)
        this.SetTheLabel(dialog,this);
        dialog.enable({"DFmt":dialog.store()["HDat"]});
    "DcSt": function(dialog)
        var oRslt = dialog.store();
        if(oRslt["Titl"])
          this.strDocTitle = oRslt["DcSt"];
    "Titl": function(dialog)
        this.SetTheLabel(dialog,this);
        dialog.enable({"DcSt":true});
    "FlNm": function(dialog)
        this.SetTheLabel(dialog,this);
        dialog.enable({"DcSt":false});
    description:
        name: "File Name Stamper",
        elements:
                type: "view",
                elements:
                        type: "view",
                        char_height: 10,
                        elements:
                                type: "static_text",
                                item_id: "TopL",
                                name: "Put Dialog Controls Here",
                                char_width: 15,
                                alignment: "align_fill",
                                font: "palette",
                                bold: true,
                                type: "cluster",
                                item_id: "cls1",
                                name: "Label Options",
                                elements:
                                        type: "view",
                                        align_children: "align_row",
                                        alignment: "align_fill",
                                        elements:
                                                type: "radio",
                                                item_id: "FlNm",
                                                group_id: "FUse",
                                                name: "Use File Name",
                                                variable_Name: "strLabSource",
                                                type: "radio",
                                                item_id: "Titl",
                                                group_id: "FUse",
                                                name: "Use Document Title (or custom)",
                                                type: "edit_text",
                                                item_id: "DcSt",
                                                variable_Name: "strDocStamp",
                                                width: 200,
                                                height: 23,
                                                alignment: "align_fill",
                                        type: "view",
                                        align_children: "align_row",
                                        elements:
                                                type: "check_box",
                                                item_id: "HDat",
                                                name: "Include Date",
                                                variable_Name: "bUseDate",
                                                type: "static_text",
                                                item_id: "sta2",
                                                name: "Format",
                                                type: "popup",
                                                item_id: "DFmt",
                                                variable_Name: "strDateFormat",
                                                width: 180,
                                                height: 23,
                                                char_width: 8,
                                        type: "view",
                                        align_children: "align_row",
                                        alignment: "align_fill",
                                        elements:
                                                type: "static_text",
                                                item_id: "sta1",
                                                name: "Font:",
                                                type: "popup",
                                                item_id: "Font",
                                                variable_Name: "strFontName",
                                                width: 111,
                                                height: 23,
                                                char_width: 8,
                                                type: "static_text",
                                                item_id: "sta0",
                                                name: "Font Size:",
                                                alignment: "align_right",
                                                font: "dialog",
                                                type: "edit_text",
                                                item_id: "FtSz",
                                                variable_Name: "strFontSize",
                                                width: 29,
                                                height: 23,
                                                type: "static_text",
                                                item_id: "sta3",
                                                name: "Color(8bit Hex RGB):",
                                                alignment: "align_right",
                                                font: "dialog",
                                                type: "edit_text",
                                                item_id: "FtCl",
                                                variable_Name: "strFontColor",
                                                width: 80,
                                                height: 23,
                                                char_width: 8,
                                type: "cluster",
                                item_id: "cls1",
                                name: "Position",
                                width: 188,
                                height: 80,
                                char_width: 8,
                                char_height: 8,
                                elements:
                                        type: "view",
                                        align_children: "align_top",
                                        elements:
                                                type: "radio",
                                                item_id: "PosL",
                                                group_id: "PosH",
                                                name: "Left",
                                                variable_Name: "strHorzPos",
                                                type: "radio",
                                                item_id: "PosC",
                                                group_id: "PosH",
                                                name: "Center",
                                                type: "radio",
                                                item_id: "PosR",
                                                group_id: "PosH",
                                                name: "Right ",
                                                type: "static_text",
                                                item_id: "sta2",
                                                name: " Margin (inches):",
                                                type: "edit_text",
                                                item_id: "MrgH",
                                                variable_Name: "nMarginX",
                                                char_width: 8,
                                        type: "view",
                                        align_children: "align_top",
                                        elements:
                                                type: "radio",
                                                item_id: "PosT",
                                                group_id: "PosV",
                                                name: "Top ",
                                                variable_Name: "strVertPos",
                                                type: "radio",
                                                item_id: "PosM",
                                                group_id: "PosV",
                                                name: "Middle",
                                                type: "radio",
                                                item_id: "PosB",
                                                group_id: "PosV",
                                                name: "Bottom",
                                                type: "static_text",
                                                item_id: "sta2",
                                                name: "Margin (inches):",
                                                type: "edit_text",
                                                item_id: "MrgV",
                                                variable_Name: "nMarginY",
                                                char_width: 8,
                                type: "cluster",
                                item_id: "cls3",
                                name: "Page range",
                                align_children: "align_row",
                                elements:
                                        type: "radio",
                                        item_id: "rAll",
                                        group_id: "GRP1",
                                        name: "All",
                                        variable_Name: "strPgRangeSel",
                                        height: 20,
                                        type: "radio",
                                        item_id: "rCur",
                                        group_id: "GRP1",
                                        name: "Current (Applies only to Open Document)",
                                        height: 20,
                                        type: "radio",
                                        item_id: "rFro",
                                        group_id: "GRP1",
                                        name: "From:",
                                        width: 12,
                                        height: 24,
                                        type: "edit_text",
                                        item_id: "tFPg",
                                        variable_Name: "strStrtPg",
                                        height: 24,
                                        char_width: 6,
                                        type: "static_text",
                                        item_id: "sta1",
                                        name: "To:",
                                        height: 24,
                                        type: "edit_text",
                                        item_id: "tTPg",
                                        variable_Name: "strEndPg",
                                        height: 24,
                                        char_width: 6,
                                        type: "static_text",
                                        item_id: "sOfN",
                                        name: "of (N)          ",
                                        height: 24,
                        type: "view",
                        align_children: "align_row",
                        alignment: "align_fill",
                        elements:
                                type: "ok_cancel",
                                ok_name: "Apply",
                                cancel_name: "Skip",
                                type: "button",
                                item_id: "But1",
                                name: "Abort Process",
                                type: "gap",
                                item_id: "gap1",
                                width: 210,
                                height: 10,
                                type: "static_text",
                                item_id: "sta1",
                                name: "version 1.2  11/5/2010",
                                alignment: "align_right",
var oDoc = event.target;
if(typeof(oDoc.xfa) == "undefined")
    global.FileNameStamp.bHidden = oDoc.hidden;
    global.FileNameStamp.nNumPages = oDoc.numPages;
    if(!oDoc.hidden)
       global.FileNameStamp.nCurPage = oDoc.pageNum;
    global.FileNameStamp.strDocTitle = oDoc.info.title;
    global.FileNameStamp.strDocFileName = oDoc.documentFileName;
    var cRtn = global.FileNameStamp.DoDialog();
    if("ok" == cRtn)
        // Setup starting parameters
        var nPgStart, nPgEnd;
        var nTextSize = Number(global.FileNameStamp.strFontSize);
        var strLabel = global.FileNameStamp.strDocStamp.replace(/\n/g,"\r");
        // Get Font Color
        rgCol = /([\dabcdef]{2})([\dabcdef]{2})([\dabcdef]{2})/i;
        rgCol.test(global.FileNameStamp.strFontColor);
        var aFontCol = ["RGB", parseInt(RegExp.$1,16)/255,
                        parseInt(RegExp.$2,16)/255, parseInt(RegExp.$3,16)/255];
        switch(global.FileNameStamp.strPgRangeSel)
          case "rAll":
            nPgStart = 0;
            nPgEnd = oDoc.numPages -1;
            break;
          case "rCur":
            nPgEnd = nPgStart = oDoc.hidden?0:oDoc.pageNum;
            break;
          case "rFro":
            nPgStart = Number(global.FileNameStamp.strStrtPg)-1;
            if(nPgStart > (oDoc.numPages -1))
              nPgStart = oDoc.numPages -1;
            nPgEnd = Number(global.FileNameStamp.strEndPg)-1;
            if(nPgEnd > (oDoc.numPages -1))
              nPgEnd = oDoc.numPages -1;
            break;
           var nTextAlign,nHAlign,nVAlign;
           var nHMarg, nVMarg;
           var nMargX = Number(global.FileNameStamp.nMarginX) * 72;
           switch(global.FileNameStamp.strHorzPos)
              case"PosL":
                nTextAlign = app.constants.align.left; // Left Aligned Text
                nHAlign = app.constants.align.left;
                nHMarg = nMargX;
                break;
              case"PosC":
                nTextAlign = app.constants.align.center;
                nHAlign = app.constants.align.center;
                nHMarg = 0;
                break;
              case"PosR":
                nTextAlign = app.constants.align.right;
                nHAlign = app.constants.align.right;
                nHMarg = -nMargX;
                break;
           var nMargY = Number(global.FileNameStamp.nMarginY) * 72;
           switch(global.FileNameStamp.strVertPos)
              case"PosT":
                nVAlign = app.constants.align.top;
                nVMarg = -nMargY;
                break;
              case"PosM":
                nVAlign = app.constants.align.center;
                nVMarg = 0;
                break;
              case"PosB":
                nVAlign = app.constants.align.bottom;
                nVMarg = nMargY;
                break;
         // Find and rename watermark;
         var aGs = oDoc.getOCGs();
         for(var i=0;aGs && (i<aGs.length);i++)
            if(aGs[i].name == "Watermark");
               aGs[i].name = "Old_Watermark";
         try{
          //  Create watermark
          oDoc.addWatermarkFromText({cText:strLabel, nTextAlign:nTextAlign, cFont:global.FileNameStamp.strFontName,
                nFontSize:nTextSize, aColor:aFontCol, nStart:nPgStart, nEnd:nPgEnd,
                nHorizAlign:nHAlign, nHorizValue:nHMarg,
                nVertAlign:nVAlign, nVertValue:nVMarg});
         }catch(e){
            app.alert("Error applying Label:\n" + e);
         // Find and rename watermark;
         var aGs = oDoc.getOCGs();
         for(var i=0;aGs && (i<aGs.length);i++)
            if(aGs[i].name == "Watermark");
               aGs[i].name = "DocumentLabel";
               break;
    else if(cRtn == "Abrt")
      event.rc = false;
else
   if(3 == app.alert(oDoc.documentFileName + ": is a LiveCycle Form, which cannot be labeled\n\n Do you want to continue processing files? (Pressing No will Abort the file processing)",1,2))
     event.rc = false;

There are a number of simpler ways to do this. Thom's Action is great, but sounds like it might be overkill for this. Text can be added a numer of ways, including a form field, text annotation, layer (aka Watermark, as with Thom's script), and stamp. It can also then be flattened so it gets converted to regular page contents, preventing the user from interacting with it and perhaps changing it. Which you choose depends on you needs. If you provide a bit more description, I could suggest a simpler script you can use.
Also, please clarify exactly what you want included. Do you want just the file name (example.pdf), the file name without the extension (example), or the complete path (c:\dir1\dir2\example.pdf)?

Similar Messages

  • Export photos with their file name stamped on to them

    Hi
    I have finished sorting, selecting, cropping etc my photos. I now wish to export low res samples of them to CD so that customers can view the samples and order prints. I can add a watermark and perform the export, but I want to add (stamp) each photo's file name to the photo sample. This would make it easier for a computer 'challenged' person to correctly obtain the correct photo file names.
    G5 iMac, iBook G4   Mac OS X (10.4.6)  

    I've not seen that as an option in Aperture. I believe your best bet is to export and html document and add the file information as part of the html.
    MacPro 2.66 4 GB   Mac OS X (10.4.8)  

  • Changing time stamp format in the file receiver adapter file name

    Hi all,
    How can we change the standard date time stamp from
    filename_yyyymmdd-hhmmss-mil
    to
    filename_yymmdd_hhmmss
    i.e.,  I want "underscores" instead of "hyphens" and also I do not want the MilliSeconds.
    I read in the forums that I have to use the combination of variable substitution and mapping functions to do this, but not sure how exactly.
    Can the experts help me with this please?
    Many thanks.

    Hello Ramesh,
         You can make this possible using runtime filename creation using UDF.
    Please go though the below steps.
    Message mapping:  
    Create an UDF and include the piece of code that captures the Filename and Timestamp from source side via ASMA.
    Modify them according to our requirement by adding the <Timestamp> at the end of <filename> with _.
    Map the UDF to any of the top level node so that the modified filename will be available for the target communication channel
    UDF Code is:
    try {
    String filename    = "";
    String timestamp = "";
    DynamicConfiguration conf1 = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
    DynamicConfigurationKey key2 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","SourceFileTimestamp");
    filename = conf1.get(key1);
    timestamp = conf1.get(key2);
    filename = filenametimestamp".xml";
    filename = filename.replaceAll( "-" ,"_" );
    conf1.put(key1,filename);
    return filename;
    catch(Exception e)
         String exception = e.toString();
          return exception;
    Click on Advanced tab and check the Option u201CSetAdapterSpecificMessageAttributesu201D in addition to that check the attribute that are required to be captured during run time. In our case File Name and Source File Time Stamp are required to be checked
    In the receiver communication channel Mention u2018 * u2018as File Name Scheme.
    Click on Advanced tab and check the Option u201CSetAdapterSpecificMessageAttributesu201D in addition to that check the attribute u201CFile Nameu201D which will carry the modified value in the UDF .
    i hope this will help you.
    Monica

  • File name with Dateand time stamp.

    Hi All,
    I want to generate a file with a date and time stamp.
    For that in File Receiver adaptor i am using option "Add Time Stamp" in File Construction mode. however it is generationg file name as: FileName_20082104_121211_645.txt . In this I don't know what these last three characters "_645" are? And In the File name i only want a file name with datetime stamp . I don't require underscore in between. for eg: FileName_20082104121211.txt (FileName_dateTime.txt)
    Can anybody suggest me the way to achive this?
    Thanks,
    Atul

    @FileName_20082104_121211_645
    The date time stamp in XI's file adapter will be in that format. This is to avoid over writing of files created simultaneously at the same time. So the last 3 digits is a form of an unique id to distinguish between the same.
    In case you want the format as FileName_20082104_121211, use the dynamic configuration and create the file name inside the mapping itself and pass it across.
    To get an idea about the same, ref:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14 - an usage of the same.
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm

  • Need to add date/time stamp to file name without time change creating new files

    We have setup our application to save data once a trigger event occurs. We also need the date/time stamp as part of the file name. We used Format Date/Time String and concatenated it into the file name. It all works good, but as the time changes (seconds, minutes, etc.) it causes the Write to File to create a new file with the new filename. Is there a way to create the file and save/latch/buffer the time in the file name so that it doesn't create a new file for every second?
    I've attached a shot of the relevant part of our VI. It's all in a big while loop. The data save is in a case/switch so that when it is triggered it starts saving. (The for loop is to split the data up
    into 4 different files). Like I said, it all works except new files are created every second as the time changes instead of just putting it all in one file with the initial time in the file name.
    Attachments:
    TimeInFileNameQuestion.jpg ‏46 KB

    I need a loop in order to use a shift register. I cannot stop the outer while loop (because it would stop the hardware from collecting data), and I cannot add loops inside which bogs down the processor to where the app stops. I've attached a simpler version of my VI which illustrates the problem. While the button is pressed (the trigger) it should save the data (in this case just cycle numbers) into one file with the initial date/time. But, you can see that it creates 1 file/second. I tried using shift registers, but without adding extra loops I can't see how to do it. Thanks
    Attachments:
    FileNameTest.vi ‏29 KB

  • How do I add time/date stamp to my screen capture file names?

    I'm on mac osx.
    I'm trying to add time/date stamp to my screen capture file names. (at the moment it's just 'Picture 1' etc..)
    I've tried the following command  in terminal but have not had success. please help!!
    defaults write com.apple.screencapture name "datestamp" at "timestamp"
    killall SystemUIServer

    Surely someone else will provide a better solution. Meanwhile, however, you might want to try the following script. Copy and paste the script into the AppleScript Editor's window and save it as an application. Then drop your screen capture files on the droplet's Finder icon.
    on open theDroppedFiles
        tell application "Finder"
            repeat with thisFile in theDroppedFiles
                set theFileName to name of thisFile
                if (word 1 of theFileName is "Picture") and ¬
                    (word 2 of theFileName = word -2 of theFileName) then
                    set theExtension to name extension of thisFile
                    set P to offset of theExtension in theFileName
                    set theCreationDate to creation date of thisFile
                    set dateStamp to short date string of theCreationDate
                    set timeStamp to time string of theCreationDate
                    set name of thisFile to "Screen Shot " & dateStamp ¬
                        & " at " & timeStamp & "." & theExtension
                end if
            end repeat
        end tell
    end open
    Message was edited by: Pierre L.

  • File name for append processing mode with time stamp

    Hi Experts
    we are doing file to file scenario using the processing mode as Append.
    the requirement for us to append the files and we need to have new file name with time stamp added to the appended file.but in the processing mode of the file adapter either we can append or add time stamp. thatz the problem I am facing now.
    we are doing file based processing not message based ,micheal blog regarding the dynamic file name is for message based not for file based.
    Please provide your valuable comments.
    Thanks
    Faheem

    Hi mohamed,
                      I suggest you to map the target source structure to the required filename u want, like for example ur filename is input26062008.txt means to the target structure u perform the following mapping
    constant (input) concat with currentdate function --> concat with constant .txt --> map this concat to target. So u will get the filename u expected with the time.
    Then in the communication channel u select the mode as append. Now ur requirement will get solve i think so. plz try.
    Regards,
    Murugavel

  • Changing an export file name by using a time stamp

    Hello Everyone,
    I am trying to create a way, utilizing the Report Attributes/Report Export field, to have an export file created with a time stamp associated with the file name.
    The reason for this is that I have users who will do multiple exports to Excel from a single parameters driven report. As opposed to manually giving the file a unique name each time the export occurs, I would like to give the export a time stamp as part of the name therefore making it unique.
    Any help would be greatly appreciated.
    Thank you

    I found the typo mm instead of MM which was my problem from the beginning.  MM represents month not mm.  A simple mistake that costed a lot of time.  Thanks Mike
    Cheers, you're very welcome. Glad I could help out.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Printing my PDF with File name and Tags Stamped on

    To Forum,
    Possibly not a completely Apple related query, but if anyone know it would be great.
    id like to print a PDF on my MBP with the File name and Tags applied to it stamped on the paper copy... or come to think of it, stamped on the PDF copy which i then print out with those stamps on. Either way will do. Any ideas? Its not immediately obvious when i look at the Printing Prefs box.

    This is an option built into various apps - Safari, Firefox, Microsoft Office.
    There are "PDF Utils" that do this on PDFs one at a time. Can't find a specific one for Macs, but found 2 for Windows.

  • Ignore time stamp in file name to load infopackage

    Hi
    Everyday a .csv file gets written into a particular folder in my application server. the filename is as TESTYYYYMMDDHHMM.csv.
    Now i have written a program to pick up the file with TESTYYYYMMDD, but the time stamp doesnt match, hence i have to ignore it when i read the file.
    Can someone please tell me some simple logic/Abap code to ignore the time stamp in the name? i have tried using TESTYYYYMMDD*.csv, but that doesnt work.
    Please help. this is very urgent.
    Thanks
    Sushmita

    I read the content of the folder into an internal table usign EPS_GET_DIRECTORY listing. i cud read that into a variable, using a simple loop.
    and pass it to the Infopackage as file name.

  • Help adding current Date and Time stamp to file name

    I need help with my script adding current Date and Time stamp to file name.
    This is my file name = myfile.htm
    I would like to save it as = myfile.htm 8/29/2007 11:41 AM
    This is my script:
    <script>
    function doSaveAs(){
         if (document.execCommand){
              document.execCommand('SaveAs','1','myfile.htm')
         else {
              alert("Save-feature available only in Internet Exlorer 5.x.")
    </script>
    <form>
    <input type="button" value="Click here to Save this page for your record" onClick="doSaveAs()"
    </form>
    Thank you

    I agree, I guess I overlooked that!
    I would like to save it as = myfile 8/29/2007 11:41 AM .htm
    I need help with my script adding current Date and Time stamp to file name.
    This is my file name = myfile.htm
    I would like to save it as = myfile 8/29/2007 11:41 AM .htm
    This is my script:
    <script>
    function doSaveAs(){
    if (document.execCommand){
    document.execCommand('SaveAs','1','myfile.htm')
    else {
    alert("Save-feature available only in Internet Exlorer 5.x.")
    </script>
    <form>
    <input type="button" value="Click here to Save this page for your record" onClick="doSaveAs()"
    </form>

  • Add the time stamp ater file name (suffix)

    Hi friends,
    i need help for below requierment.
    I want to add the time stamp for my file name.
    like *filename YYYY-MM-DD-HH-MM-SS.txt*
    i don't know how to wirte the UDF for this. please any help me on this.
    thanks
    Srini..

    Hi,
    You have to Use Add Time Stamp Option in the Receiver File Adapter--Under File Construction Mode
    Check this
    http://help.sap.com/saphelp_nw70/helpdata/EN/ae/d03341771b4c0de10000000a1550b0/frameset.htm
    REgards
    Seshagiri
    Edited by: N V Seshagiri on Oct 14, 2008 2:02 PM

  • Sender File adapter - DataTime stamp at the end of aarchived file name

    Hello,
    I am archiving the file once PI file sender adapter picks the file from source directory.
    The file is archived in the archive directory as <Date-Time-SSS_>FileName.
    I need to append the value <Date-Time-SSS_> after the file name.
    So archived file looks like FileName_<Date-Time-SSS>
    How can I achieve this? Appreciate your help for valuable suggestions.
    Thanks,
    Namadev

    Hi Namdev,
    Generally when we archive file then in sender CC we just put the processing mode as Archive and specify the Archived directory name in Archive Directory section. in that case when the Communication channel pick the source file then after picking it it remove it from source directory and put it into Archived directory without making any change in the file name.
    so if the file name is A.txt then in Archived directory also its name will be A.txt . However if you want to make any change in the name of the source file in the archived directory then you have two write Unix or DOC scrpt( depending upon your soure server )
    if your source server is Unix then write shell script otherwise dos scriprt
    .after wrtting the shell script just place in the archived directory or your source directory and call it in by mentioning it in Coomand Line section of your sender CC. You can easily search and get the required  shell script .
    Regards,
    Saurabh

  • Change in time stamp format in receiver file name

    Hi,
    We have a scenario as AS2 - PI - FTP Server (AS/400). We want target file name as BMMDDHHSS where B is constant and
    MM (month e.g., 01), DD (day e.g., 12), HH (hour e.g.,11), SS (seconds e.g., 12). Is there standard way of doing this, just by changing some configuration in receiver file adpter?
    Please let me know, how could we do this using PI. If script is optional, keeping as back-up only.
    How come, naming dynamic receiver file names are so difficult in PI. I have been trying to get the answers for our another requirement like to name receiver file as C1.YYMMDD.C2 in a file pass through scenario for more than a month.
    It is just file through scenarios, so we can't use variable substitution as we are not going to read content/payload of file
    Thanks in advance,
    - Riya Patil

    Hi Shabarish 
    Thanks for your reply. I have trying to make this UDF work since almost a month with no luck. Can you please check where am I doing wrong?
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String SourceFileName = "C1." + a + ".C2";
    conf.put(key, SourceFileName);
    return " ";
    In the above code, I am passing date as "a". And mapping CurrentDate (formatted) --> UDF --> Target root node.
    I am getting the following error in SXMB_MONI:
    <SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
      <SAP:P1>com/sap/xi/tf/_MM_Lockbox_Filename_</SAP:P1>
      <SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
      <SAP:P3>Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:P3>
    <SAP:Stack>com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_MM_Lockbox_Filename_: Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:Stack>
    Your help would be much appreciated.
    Thanks,
    Riya Patil

  • Search for a file name by time stamp

    Powershell allows us to append the date faily easily to a file name (eg. "test.txt $(get-date -f dd-MM-yyyy).txt").  I'm looking for a simple script to search for a powershell script by a static name with todays date appended.  I
    then want to move that file to a another location and rename it. For example lets say the file name is test.txt always and a 3rd party software names it to test12-9-14.txt daily so tommorow it would be test12-10-14.txt and so on.  Each day I need
    to take the file testxx-xx-xxxx.txt from the the c:\ drive and move it to the w:\ drive and change the name from testxx-xx-xxxx.txt to test.csv.

    I found the typo mm instead of MM which was my problem from the beginning.  MM represents month not mm.  A simple mistake that costed a lot of time.  Thanks Mike
    Cheers, you're very welcome. Glad I could help out.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

Maybe you are looking for