Correlation using file name

Hi all
i have a scenario where I have to place a file at target with a particular file name, say, my_name_is_itisha.txt .After the target processes the file,it places an acknowledgement file with the name my_name_is_itisha_txt.ack.
In short, the ack file will replace the '.' with '_' and append '.ack' to the file placed by me at the target.
I know that we can correlate 2 files with similar fields but how to correlate 2 files with the same name ?
Please suggest a solution.
Edited by: itisha alok on Apr 28, 2009 1:39 PM
Edited by: itisha alok on Apr 28, 2009 1:40 PM
Edited by: itisha alok on Apr 28, 2009 1:40 PM

Hi,
Sorry for the late response....
can you please tell me how to get the filename in the mapping?
This is achieved by writing a UDF in the corresponding Message Maping.....this udf will do the function of extracting the filename during runtime....the UDF is already provided by Srini....even you can search SDN for Dynamic FileName and you will get lot many threads....you need to use Adapter Specific Message Attributes (ASMA) for this purpose.
The UDF need not have any arguments/ parameters.....as it does not need any input from any of the Source nodes.....it will extract the information (filename) from the message header....
For more info: http://help.sap.com/saphelp_nw70/helpdata/EN/43/03612cdecc6e76e10000000a422035/frameset.htm
Regards,
Abhishek.

Similar Messages

  • Using File Name to determine the Receiver

    Hi All,
    I have to determine the receivers based on the Input file name. I am using the context object File Name in the condition editor. But based on the first 4 characters of the FileName I have to route the file. Can anybody please help how to formulate this expression in the condition editor?
    Thanks,
    Geetha

    Hello Geetha,
             You need to specify this in you mapping as in condition editor you can not specify values at runtime. What you need to do is
    -> Select the Extended Reciever Determination in ID
    ->In IR specify the mapping for determining the receiver (You need to use the another mapping for this)
            . Here copy the MessageType 'Receivers' from the component  as your target MT
              SAP BASIS 7.0 (Depends on your version)-> "htt://sap.com/xi/XI/System" namespace.
           .  Define Message Mapping between Outbound Message Type(The one with your filename) and 
             Standard Message Type u201CReceiversu201D which is as Inbound message type and which is in the SAP
             BASIS -->http://sap.com/xi/XI/System
           . In mapping specify your service based on your First 4 character of your file name(Use SubString)
    IF filename -> SubString(0,4) ->Equals ->   filename -> SubString(0,4)  Then  Select Your Service  ( Service in Constant value). ELSE (your logic)
    Once you finish this remaining as usual in IR, while InterfaceMapping you select two mapping programs.
    Remmber to use the Extended Interface Determination in ID, This resolves your issue.
    Regards,
    Pasanna

  • Using file names as picture text in iMovies

    I have been using IDVD and it allows you to use the filename as the title of the picture in the slideshow. It is convienant since i dont have to relabel my pictures. So if the file name of the picture is mummy with auntie Kay, then that will appear as the title of my picture. Does Imovies have a similar feature? or do i have to painstakingly relabel all my pictures?

    There is no similar feature in imOvie that I know of.

  • Importing in to iPhoto using file name date/time

    Hi
    +*I posted this originally in to iPhoto section but they suggest I submit here to see if anyone knows if there's an applescript. Thanks!*+
    I'm not too sure on how to exactly explain my problem but here goes...
    I have a mobile phone that does not save date/time taken data to the picture file when it takes photos. All of my previous phones/cameras have so this has never been a problem before. I Bluetooth photos and then add them to iPhoto '08.
    Problem is when they add they use the date/time added to create the event rather than the date/time taken. The picture filename displays date/time taken and I was wondering if there was a way to use the filename to have iPhoto adjust the metadata tag to the actual date/time taken? This would save me having to adjust time/date for each set of photos. The filename is for example P090308_12.00.jpg if taken on 09/03/08 at 12.00pm.
    I hope this is clear enough and that someone has some advice. Thanks for your help

    01. As per casdvm, download 'ExifTool-7.20.dmg' (872 KB in size), and install 'exiftool''.
    02. Try the provided starter code, editing it according to your needs ...
    --- Code starts here ---
    tell application "iPhoto"
    set tSelection to selection -- Obtain list of selected photos.
    repeat with i in tSelection
    try -- Capture any unexpected AppleScript error(s).
    set imagePath to (image path of i) -- Obtain full path of file.
    set imagePath to quoted form of imagePath -- Encase files' full path in single quote marks.
    set {oAStid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "/"}
    set imageName to last text item of imagePath as string -- Extract file name from files' full path.
    set AppleScript's text item delimiters to oAStid
    set imageName to get (characters 2 through ((count imageName) - 5) of imageName) as string -- Extract date and time values from file name.
    set tYear to (get (characters 5 through 6 of imageName) as string) -- Extract year from file name.
    if (tYear as number) > ((do shell script "date +%y") as number) then
    set tYear to ("19" & tYear) as string -- Append '19' before 'tYear'.
    else
    set tYear to ("20" & tYear) as string -- Append '20' before 'tYear'.
    end if
    set createDate to tYear & "." & (get (characters 3 through 4 of imageName) as string) & "." & (get (characters 1 through 2 of imageName) as string) & " " & (get (characters 8 through 9 of imageName) as string) & "." & (get (characters 11 through 12 of imageName) as string) & ".00"
    do shell script ("exiftool -DateTimeOriginal='" & createDate & "' -CreateDate='" & createDate & "' -overwriteoriginal_inplace " & imagePath) -- View 'exiftool -h' in 'Terminal'.
    end try
    end repeat
    end tell
    --- Code ends here ---

  • The Organizer – Using file names as captions in SlideShow

    I am using Vista. 
    I just switched from using ZoomBrowser to The Organizer and I have a collections of thousands of photos. In ZoomBrowser I could show the file names (which I used to describe the slide) at the bottom of the slides during a slide show. I have not found such a feature in The Organizer. Is there one?
    Otherwise, is there a method whereby I can do a batch import of the file names into the captions in the photos in The Organizer? I have the Flash Rename software which I can probably use to place the text of the file names in the Details of the Properties of the photo files.
    Please help,
    CarlosWA

    There is no similar feature in imOvie that I know of.

  • Using File Name as Watermark

    Is it possible to export a JPEG version of a photo with the file name displayed on the photo? This would be useful for a big proofing job I have. I haven't been able to find any info on this in Aperture support or even any third party software for this purpose in a general internet search. Any ideas? Thanks!

    The free and rather good plug-in BorderFX will allow you to position metadata on top of the image and export as a JPG file.
    If PDF will do, Aperture includes good tools to create contact sheets with metadata. These can be saved as PDFs from the OS X print dialog (i.e.: not the Aperture dialog, on which you format the page, but the next one, from which you actually send the job to the printer).

  • 5.5 Issue, no longer saves Project Title, no longer uses file name

    I often work in mammoth multi-slide projects and then break them into more reasonable chunks later on, deleting extra slides and saving with a differnt file name. In Captivate 4.0 this automatically updated the Project Title in the Publish Dialog. In 5.5 it retains the old name, even after saving or publishing it. This can lead to over-writing the original project.
    In recent days I've discovered a truly bizzare workaround, completely by accident. A colleague was doing some QC and saved slides with completely new names. Although the Project Title wrongly retained the original file name, when I changed it to publish the slide, and then immediately used "Save As..." to save it with the same file name as the Project Title I just published, it finally retained the new name---in other words the Project Title I just published was still there after I closed then opened the file. If I Save As... before publishing it displays the frustrating broken behaviour, and when I tried it on some other files I had renamed it didn't work either... it seems as if the magic is available only on the first Save As... after renaming.
    Anyone else seen this? Any better workaround? Can we expect a fix? When?
    Thanks.

    yes i've seen that before.  I had a prototype of a project and as it progressed beyond a prototype I started saving and publishing with a new name.  But when I publish now it retains the name I used for the prototype, even tho I've published it several times with the new name.  Always defaults back to the first name I used.  You're not alone in your frustration. 
    I'll try to test it a little tomorrow to see if your workaround works for me.

  • Captions using file names? (Photoshop Album Starter Edition)

    In Photoshop Album Starter Edition, is it possible to create a slideshow and use the file name (i.e. "Red Sails in the Sunset.jpg")as a caption that is viewed within the slide show segments? If not, is there another Adobe product, possibly Elements, that can do this? Thanks, Van.

    Somewhat related:
    I have used tags to organize my photos, but it seems this will be lost if I ever move to another program (e.g. Picaca - though Adobe was able to import one Picasa tag). My questions:
    1. How can I permanently associate tag-type info with my photos?
    2. Can I use a simple or batch method to use my filenames (which have a lot of info) as captions?

  • Get handle of sequence file using file name

    in example it is described how to access the comment of a sequence file.
    During report generation I only have the file name of the sequence file not some sequence file struct which is needed.
    How do I get that using the sequence file name?

    Hi mbrost,
    Try this TS2.01f1 example.
    I have put in an override TestResult Callback sequence and added some code to obtain the comment of the Sequence File. I have also added a Comment to the Sequence File.
    Using RunState.SequenceFile as the ActiveX Reference I get a reference to PropertyObjectFile.Data which return a reference. Using this reference I then call the PropertyObject.Comment() API to obtain the comment string.
    Then I display this Comment string in a MessageBox.
    Hope this helps
    Regards
    Ray Farmer
    (PS. ignore the name markp01 as NI site is getting people mixed up)
    Attachments:
    Access_SequenceFile_Comment.seq ‏59 KB

  • Can I use file names from some folder to specisfly a value of a variable

    so here is the thing I want to do:
    I've got like 3 variables in my swf file which value tells to
    the code how many picture there are to load.
    So I have like
    var totalPics:Number = 5
    in my folder images I have 5 pics, but I want to put 3 more
    so I want to make suck code that will check the total files in the
    folder and return a value of 8 or check the name of the last file
    found in the foulder like pic8.swf (I've made it into swf to load
    in a loader) and to take that letter 8 from it as a value to put in
    the variable totalPics so it is = 8.
    Can u tell me is this possible to make in flash.... where I
    should read helps or guides .. or just give me a simple example
    please.
    Thank u a lot. If u have any more questions, just ask me..

    Very helpful of you guys ;] Thanks a lot.. so lets continue
    on the matter..
    GWD the second option is good but can work in a simplier
    code.. mine is a bit complexed and by that I mean.. that the total
    number of pics or things to load should be known for the main swf
    file at his start. That is because before the turn for the pics to
    load comes, there is something else that must happen first, and it
    depends on that total number (actually 3 total numbers cuz there
    are 3 folders with different pics that must mix) So.. can't use the
    second option cuz it works good when the code is a bit more simple
    than that.
    If u didn't understand whant I tried to explain.. doesn't
    matter.. not so important atm.
    Now the thing with the LoadVars.. yes, I've been thinking the
    same thing but like this: At the 1st frame in the main timeline I
    have 3 variables that are used further in the code and that must be
    predefined by how many pics there actually are, so.. I've been
    thining to make 3 different var1.txt, var2.txt and var3.txt files
    for example and to put there as value just the number I need. So
    when I add more pics for example to my images folder, I edit the
    txt file containing their total number and just change it so the
    code can automatically add the new pics to the sequence.
    I've got some examples of this how LoadVars works with txt
    files and I think I can manage to do that, but anyway would be nice
    of you to give me some example ;] and of course correct me if my
    toughts above are not true.
    Now.. SumTsb.. what u mentioned, I am interested in, because
    I have a PHP guy, who can make me a code that automatically counts
    and gives back the totalPics number from a certain folder (I don't
    know for sure that it is possible but if it is he can do it). My
    point is.. When he makes this code.. that reterns value of
    totalPics, how can I redirect it so it changes the value of
    totalPics inside my main swf file. I see only this as option at the
    moment:
    1) when someone adds or deletes files from the folder the php
    code returns a different value, equal to the number of files in the
    folder, and automatically changes the content of the file var1.txt
    like this:
    First off var1.txt has: &content=10 // this is the total
    number of pics/swf files in the folder;
    when u add.. like 3 more files.. the php code changes the
    value inside of var1.txt to: &content=13 and when the main swf
    is started he takes the new value and my problem is solved. Is this
    what I say as example true ? If it is I guess the only thing left
    for me is the php programer to make his code and job is done.
    But answer me this question too: is it possible the php code
    to return the value of the totalPics directly into the main swf
    file. So if I have inside the main swf a variable at the first
    frame ot the main timeline called totalPics, can the php give it a
    value equal to the total numbers of files in a folder, and how ?
    I guess I've written too too much :D so I'll wait what u will
    answer me now.. I think you understood my idea.. and if more
    questions arise I will write u back. And if no.. I will just thank
    you a lot :D

  • Download files from application server - unknown file name

    Hello everybody,
    I am working on a report allowing users to download XML files from the application server. All these XML files are created by the SAP system and their names can be found in a table. I can simply use OPEN DATASET for these files, put all file content to a buffer and send them to the GUI with CALL METHOD cl_gui_frontend_services=>gui_download.
    The problem is now that some files are touched by an external document management system. These files are moved to another directory and timestamped. The first is no problem since the folder name is always the same and can be replaced before the OPEN DATASET statement. But additionally, the file gets a timestamp, when the filename was xyz.xml before, it now gets xyz.xml.01012008123456123456. As I cannot try all possible values (mircoseconds!), I need a way to search for the right filename on the application server. Is there a function module for this available?
    It can always be stated that the former name (xyz.xml) is still a unique prefix, so I don't have to worry that xyz.xml.* will return multiple files.
    Thanks in advance for any suggestions.
    Christoph

    HI!
    I copy the function GET_DIRECTORY_FILE. In the eyelash of tables create one structures:
    DIR_FILES           LIKE                  ZDIR_FILES
    The single structure has component NAME (char 250).
    I code of the function that I use is:
    FUNCTION zget_directory_file.
    ""Interfase local
    *"  IMPORTING
    *"     REFERENCE(NAME_OF_DIR) TYPE  CHAR120
    *"     REFERENCE(NAME_OF_FILE) TYPE  CHAR120 OPTIONAL
    *"     REFERENCE(SP_CS) TYPE  CHAR120 OPTIONAL
    *"  TABLES
    *"      DIR_FILES STRUCTURE  ZDIR_FILES
      DATA: a_dir_name TYPE  char120,
            a_generic_name TYPE  char120,
            a_must_cs TYPE  char120.
      a_dir_name      = name_of_dir.
      a_generic_name  = name_of_file.
      a_must_cs       = sp_cs.
      DATA: errcnt(2) TYPE p VALUE 0.
      IF a_dir_name IS INITIAL.
       MESSAGE e220.     " 'Place cursor on valid line !'.
      ENDIF.
      CALL 'C_DIR_READ_FINISH'             " just to be sure
          ID 'ERRNO'  FIELD file_list-errno
          ID 'ERRMSG' FIELD file_list-errmsg.
      CALL 'C_DIR_READ_START' ID 'DIR'    FIELD a_dir_name
                              ID 'FILE'   FIELD a_generic_name
                              ID 'ERRNO'  FIELD file-errno
                              ID 'ERRMSG' FIELD file-errmsg.
      IF sy-subrc <> 0.
        sy-subrc = 4.
        EXIT.
      ENDIF.
      file-dirname = a_dir_name.
      DO.
        CLEAR file.
        file-name = '*.zip'.
        CALL 'C_DIR_READ_NEXT'
          ID 'TYPE'   FIELD file-type
          ID 'NAME'   FIELD file-name
          ID 'LEN'    FIELD file-len
          ID 'OWNER'  FIELD file-owner
          ID 'MTIME'  FIELD file-mtime
          ID 'MODE'   FIELD file-mode
          ID 'ERRNO'  FIELD file-errno
          ID 'ERRMSG' FIELD file-errmsg.
        file-dirname = a_dir_name.
        MOVE sy-subrc TO file-subrc.
        CASE sy-subrc.
          WHEN 0.
            CLEAR: file-errno, file-errmsg.
            CASE file-type(1).
              WHEN 'F'.                 " normal file.
                PERFORM filename_useable USING file-name file-useable.
              WHEN 'f'.                 " normal file.
                PERFORM filename_useable USING file-name file-useable.
              WHEN OTHERS.              " directory, device, fifo, socket,...
                MOVE sap_no  TO file-useable.
            ENDCASE.
            IF file-len = 0.
              MOVE sap_no TO file-useable.
            ENDIF.
          WHEN 1.                     " end of directory
            EXIT.
          WHEN 4.                     " filename too long
            MOVE sap_no TO file-useable.
          WHEN OTHERS.
            ADD 1 TO errcnt.
            IF errcnt > 90.
              EXIT.
            ENDIF.
            IF sy-subrc = 5.
              MOVE: '???' TO file-type,
                    '???' TO file-owner,
                    '???' TO file-mode.
            ELSE.
            ULINE.
            WRITE: / 'C_DIR_READ_NEXT', 'SUBRC', SY-SUBRC.
            ENDIF.
            MOVE sap_no TO file-useable.
        ENDCASE.
       PERFORM p6_to_date_time_tz(rstr0400) USING file-mtime
                                                  file-mod_time
                                                  file-mod_date.
      * Does the filename contains the requested pattern?
      * Then store it, else forget it.
       MOVE-CORRESPONDING file TO file_list.
       APPEND file_list.
        MOVE file-name TO dir_files-name.
        APPEND dir_files.
       IF a_must_cs = no_cs.
         MOVE-CORRESPONDING file TO file_list.
         APPEND file_list.
       ELSE.
         IF file-name CS a_must_cs.
           MOVE-CORRESPONDING file TO file_list.
           APPEND file_list.
         ENDIF.
       ENDIF.
      ENDDO.
    ENDFUNCTION.
    *&      Form  filename_useable
          text
         -->A_NAME     text
         -->A_USEABLE  text
    FORM filename_useable USING a_name a_useable.
    *--================--
      DATA l_name(75).
      l_name = a_name.
      IF l_name(4) = 'core'.
        a_useable = sap_no.
      ELSE.
        a_useable = sap_yes.
      ENDIF.
    ENDFORM.                    "FILENAME_USEABLE
    With this I obtain all the archives XML of that route in a table
    DATA: zfiles LIKE STANDARD TABLE OF zdir_files WITH HEADER LINE.
    CALL FUNCTION 'ZGET_DIRECTORY_FILE'
      EXPORTING
        name_of_dir = dsn
      TABLES
        dir_files   = zfiles.
    IF sy-subrc = 0.
      LOOP AT zfiles .
        IF  zfiles-name+0(2) = 'O_' AND
            zfiles-name+2(3) = sy-mandt AND
            zfiles-name+5(1) = '_' AND
           zfiles-name+22(4) = '.xml'.
          file = zfiles-name.
    endloop.
    endif.
    I hope this helps you.
    Regards.

  • When I import photos from PC to iPhoto can I sort by file name?

    ***Planning on converting from PC to Mac soon.***
    I have organised my photos on my PC into folders. For some of these photos I have renamed the files to ensure they always display in a certain order when sorted alphabetically.
    I am aware that iPhoto does not really use file names. I see the advantages of this but as I am used to the Windows convention I have the following question:
    When I import my photos to iPhoto, will they still be sorted alphabetically by the file names I have carefully created on my Windows PC, or will I need to resort them manually?
    Thanks!

    When you import into iPhoto, each imported set goes into a folder called Last Import.
    One way to do what you want without losing your organization:
    iPhoto / File / Import to Library. Navigate to the first folder on the pc. and click on Import. The contents of the folder on the PC will all come together.
    On the Mac the photos will be in the folder called Last Import.
    On the Mac, create a new folder with the name you want. (File Menu / New folder)
    Move the photos as a batch (select all) from the Last Import folder to the one you just named.
    Do this as many time as you have folders.

  • 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)?

  • Image file names changed on Homepage

    I have found, on several occasion,s that the titles of the images on my homepage have lost their file names and show the filename iPhoto gives it when uploading to Homepage i.e. Image123A123B123C etc Sometimes, it shows OK when viewing the page but not when editing the page.
    All my images are given my job number reference for people to order from so loosing them is a big issue.
    homepage.mac.com/cjbphotography/

    The exif "image file name" is probably only used by some cameras, I don't have anything in there either.
    Instead use "file name" under "other", that is the actual file name of the master file.

  • Filter on File Name

    The filtering options in Aperture 3 is very powerful but I can't find a way of filtering on the file name. In the "Add rule" in the pop-up menu for filtering there is no choice of "File name" but a whole lot of other choices.
    When I choose a picture and select "File Info" in the Metadata pane, I see both the version name and the file name. I can also sort my pictures using file name, but I can't create a filter searching for the file name.
    Am I missing something?

    Thank you!
    It didn't occur to me that a file name could be a metadata, but there you go...

Maybe you are looking for

  • Installation error Solaris 10-u6-ga1

    I must be missing something really obvious on the installation of Solaris 10 U6. I've come up against the error message upon manually partitioning, and using UFS. After the install the error is: Solaris 10 10 software installation partially failed So

  • Translation of scripts into 'FR' language

    I have a requirement. Iam translationf remit advice script into 'FR' language. For this it is using RFFOF_T driver program. Iam running this script through F110 tcode. And this job is running in back ground mode.But in the job log is is giving the er

  • Why is serial# needed for unique session info

    hello everybody, as you know, a session is unique with 2 fields, SID and SERIAL# which exist on v$session view. my question is why is serial# needed and for which case serial# is changing. now, you can say that, "only oracle developers know this, tha

  • Easy Wireless 802.1x solution

    Hi All, Looking for an easy way for our students to connect to our wireless. Our current setup is using WEP with PEAP and AD. We use WLC's and ACS and AD. We basically want it set up as easy as possible so that our students can connect with no proble

  • Storing int variable in application scope

    hi all, I have a requirement where i need store some counter(int) in the application scope. Please tell me how to do that. I know create instance of userbean in application scope, but how to do for integer. Thanks in advance. -Manjunath