Getting a Filename

I have a task to do with Indesign XML workflow.
Is there any option for getting a file name to a variable in the corresponding folder
for example: "test.xml"
the filename "test" needs to be saved in a variable, i.e., any xml file which i placed in the corresponding folder the filename has to saved in a variable.
Is it possible...
Please help me.
Sajeev

Thanks Tomaxxi for your speedy reply
It really helps me
Actually i have a doubt, in the above script you have mentioned the file path including filename in a variable "myFile", is it possible it automatically store the file name in the corresponding folder, my file name will change each an every time
Sajeev

Similar Messages

  • How to get open filename in Reader

    Hello,
    I am looking for a way to get the filename of the open document in Acrobat Reader window from a C# application I am working on.
    I can't find a way to do it... I am so desperate I am thinking on create a plug in or something for Acrobat Reader so I will be able to get the information from the plugin...
    Any help/ideas on how to do it are welcome.
    Thanks

    There is no approved/supported way to do so, other than the use of a custom plugin for Reader (which will require a Reader Integration License).

  • How to get image filename in indesign cs3

    Hi,
        I want to get a filename of a selected rectangle frame graphic child item like tiff image or pdf file. Please help me with a code snippet.
    Thanks,
    K.Saravanan.

    app.activeWindow.activeSpread = myDocument.spreads[j];
    app.activeWindow.zoom(ZoomOptions.FIT_SPREAD);

  • Is there a way to get the filename only on iOS using CameraRoll?

    This post is a sidetrack from this post: http://forums.adobe.com/thread/848761?tstart=0
    The method used in that post works perfect on both Android and iOS for selecting and uploading files.... BUT is there a way to get the filename of the file from the mediaPromise cross-plattform?
    If you let the user select an image it's not very nice to have the image be called "temp.jpg" after uploading - you want the user to know which image he/her have uploaded
    Any ideas? The "mediaPromise.file.relativePath()" works on Android but not on iOS. Not "mediaPromise["file"].url/relativePath/nativePath" either.
    Thank you

    Hey Joe what do you think of this solution.
    1. Let the user select the image
    2. Store the mediaPromise object in an array (event.data) for later use
    3. Load in the object using loadMediaPremise
    4. Add the loaded image into a movieclip (not visible from the scene)
    5. Resize that movieclip to let's say 100x100
    6. Use the BitmapData class to create a new bitmap from that movieclip and save it to storage
    7. Use the saved file within the app as a thumbail
    8. Use the mediaPromise object stored in the array later when the user wants to upload the images (then go through mediaPromise.open() on each image -> save to storage -> upload -> clear from storage -> loop).
    I haven't tried it yet (will do this week) but should that be a acceptable solution to the problem(?)
    I'm unsure if by just keeping the mediaPromise object within Flash will make the memory run wild though?

  • To upload the ZIP file and get the filenames available in ZIP file in ABAP

    Hi Experts,
    For my requirement, file from legacy comes as ZIP file with number of files in that.
    Please provide one code sample to upload the ZIP file from local workstation and get the filenames available in ZIP file to check few filename validation checks for the available files in report program.
    Thanks in Advance,
    Regards,
    Basani

    1. Copy the ZIP file into App server
    2. Call function
      call function 'RFC_REMOTE_PIPE'
        destination 'SERVER_EXEC'
        exporting
          command = command  " Unzip command gunzip /path & file
          read = 'X'
        tables
          pipedata = std_lines
    then you can read the files and can validate the file names

  • How to get the filename from J2SE File adapter

    In our project scenario , we are using J2EE and J2SE engine both .J2EE for mapping  and J2SE for Deliveying the message .
    In one senario, routing will be based on the filename .
    J2SE Sender File adapter --- XI Adapter --- XI pipe line
    So the File reaching to XI pipelane via J2SE File adapter--> XI adapter.
    When we are using the dynamic configurator in the XI to get the filename
    we are not able to get the file name  becasue it is coming to XI via
    XI adapter.
    How to get the filename ????Hope I am clear about the problem.

    hi,
    try this
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    //obtengo la Key del FileName
    DynamicConfigurationKey keyF = DynamicConfigurationKey.getName();
    http://help.sap.com/javadocs/NW04/current/pi/com/sap/aii/mapping/api/DynamicConfigurationKey.html
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70c89607-e4d9-2910-7280-f6746e964516
    /people/mohammed.zabiulla/blog/2008/03/26/have-you-ever-tried-to-determine-mail-cc-dynamically
    Hope it helps
    Thanks
    Rodrigo
    Edited by: Rodrigo Pertierra on Apr 11, 2008 9:31 AM

  • How can i get report filename in a fomula column

    Hi,
    We are using Oracle Reports 6i.
    i want to get the filename of current report in a formula column.
    how can we take the current report filename into a variable in a formula column..
    If it is possible please provide your valuable inputs on how to achieve this or please provide any helpful pointers
    Please get back to me if my requirement is not clear
    Thanks,
    anish

    Its not possible to get the report file name in a formula column

  • How to get the filename of the active jsp page?

    how can i get the filename of the active jsp page?

    You could register the JSP [ages in the web.xml and then use the ServletConfig.getServletName.
    You could use the JspContex.getServletName which will return the registered name or the name of the servlet class.
    You could programmatically add a page context attribute that holds the jsp page name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to get the filename when parsing a file with d3l

    All
    After some time have experience with interconnect, IStudio I need the following info. Is it possible to get the filename when parsing a flat file using a d3l? This is needed because we need to store the filename together with the data into the database.
    Any examples or directions to some documents are welcome.
    Regards
    Olivier De Groef

    has anyone some info on this

  • Getting the filename of a placed image inside a smart object

    Hi
    I'm wondering if I can get any help with a problem I'm trying to overcome for a friend of mine.
    My friend is a photographer who does a lot of schhols work (pupil portraits) and wants to create a little document similar to this (very simplified) version:
    I'm trying to help him to create a batch process so that he can make this take up much less of his time!
    Here's where I've got to so far. I've created the layout above which is essentially a smart object (from an external file) manipulated in a couple of ways.
    The workflow as I see it at the moment (although I'm wide open to suggestions, and I'm having a bit of Friday brain) is this: I generate an action that replaces the content of the external file with the contents of (each file in his incoming list, sequentially).
    That file then comes back into the layout above and a new (flattened) copy is saved out from there.
    Rinse and rerpeat through the list of incoming files.
    I can just about make that bit happen using actions, but here's what I can't get - the filename of the incoming file (the one that's placed in the smart object). Can I can use a modified version of the AddFileName script to generate a text layer based on the filename of the placed contents in the smart object? Does any of that make sense? I'm reading this back to myself and even I'm not sure! ho ho.
    My lack of logic/coherent sentence structure here is what probably holds me back in any eforts I have made in getting into scripting.
    I'd appreciate any help that could be offered.
    Thanks.
    Fenton

    Ah - alas it sems not to be. I think I am going to have to come up with a different workflow and by extension, solution. My current thinking is that I need to have an input folder for the images to be used in the layout, and an output folder for the results to be saved into, along with the layout.psd (as above) all housed in the same folder. Then I need (help) to write a script that does the following:
    Checks that the layout document is open (that bit is easy enough)
    if(documents.length==0){
       alert("You need to have your layout template open (-layout.psd-)")
    }else{
        // Do next bit here - and what I'm trying to do is described below.
        // Hopefully by typing it out I might start to get it straight in my head
        // Any help with any part of this process is greatluy appreciated
        // I'm trying to learn!
    Then what I think the script needs to do is tocheck the contents of the input folder and find out how many files are in it then set this as a variable, to set the length of a loop, maybe? Or should it load the filenames as an array and work through them sequentially?
    Once that information is established, there is a smart object on the first layer that needs to be updated with the contents of the first file - my thinking s that this is done by the script opening each image, and then copy/pasting into the smart object, merging down (so I don't end up with an enormous multi-layered file). My reason for thinking this would be a good idea would be that I could just run a quick check to make sure that no landscape pics have sneaked in there and if they have, rotate them (which again, is pretty easy as even I could do that bit, too).
    doc = activeDocument;
                if (doc.height < doc.width) {
                  doc.rotateCanvas(90);
                } else {
                  // Carry on
    This will update all of the smart object instances throughout the layout template.
    Then the text underneath the main image needs to be updated with the filename of the file that has been pasted in the smart object, and after that a [flattened] copy saved out to an output folder.
    Rinse and repeat for the remaining images in the input folder.
    Any thoughts?
    Thanks
    Fenton

  • [JS CS4] Getting unexpected filenames - *TempScratchDocument*

    Hi,
    I have a Startup Script which launches event handlers to write to a log file when an InDesign document is opened and closed.
    The functions write the filename, username and time of the event to the log file but I am getting unexpected filenames written to the log and wondered if anyone could explain where these are coming from.
    An example from the log file is:
    Started: Untitled-4 lhusband Wed Jun 09 2010 10:55:34
    Finished: -/*TempScratchDocument*/- lhusband Wed Jun 09 2010 10:55:34
    It is the -/*TempScratchDocument*/- bit I don't understand.
    My thoughts are that doing a copy/paste or saving a snippet or putting something in a library could be creating a "new" temporary document somewhere in InDesign memory, but I cannot replicate this on my own PC.
    This script is running on 30 PCs and I only get this for 2 or 3 users.
    The event listeners are:
    var myEventListener1 = app.addEventListener("afterOpen", openJob, false);
    var myEventListener2 = app.addEventListener("afterSaveAs",openJob, false);
    var myEventListener3 = app.addEventListener("afterNew",openJob, false);
    var myEventListener4 = app.addEventListener("beforeClose", closeJob, false);
    var myEventListener5 = app.addEventListener("beforeSaveAs",closeJob, false);
    The two function called are:
    function openJob(myEvent) {
            var myDate = new Date;
            var myTime = myDate.toString();
            var myEventTime = myTime.slice(0,-9);
            var user=getUser(); // function to get username
           try  {   var myPath = myEvent.parent.fullName } catch(e) { var myPath = myEvent.parent.name } // to handle unsaved documents
        // Write to Jobs.Log
            myFile = File("//10.19.55.220/Logs/jobs.log");
            myFile2.open("a");
            myFile.write('\n' + "Started:" + '\t' + decodeURI(myPath) + '\t' + user + '\t' + myEventTime);
            myFile.close();
    } // end of function
    function closeJob(myEvent) {
            var myDate = new Date;
            var myTime = myDate.toString();
            var myEventTime = myTime.slice(0,-9);
            var user=getUser(); // function to get username
           try  {   var myPath = myEvent.parent.fullName } catch(e) { var myPath = myEvent.parent.name } // to handle unsaved documents
        // Write to Jobs.Log
            myFile = File("//10.19.55.220/Logs/jobs.log");
            myFile2.open("a");
            myFile.write('\n' + "Finished:" + '\t' + decodeURI(myPath) + '\t' + user + '\t' + myEventTime);
            myFile.close();
    } // end of function
    If anyone can shed any light on this I would be most grateful.
    Thanks
    Simon Kemp.

  • Getting PDF filename with unicode chars

    Hello,
    I'm trying to write a plugin that gets the file path of the current active document. The code looks like this:
    AVDoc avDoc = AVAppGetActiveDoc();
    PDDoc pdDoc = AVDocGetPDDoc(avDoc);
    ASFile file = PDDocGetFile (pdDoc);
    ASPathName filePath = ASFileAcquirePathName (file);
    This works fine for most documents, but for documents with unicode characters in the name each unicode character is replaced with '.' in filePath. For example, if the document is "测试中文关键词搜索!@#$%^&().pdf", then filePath becomes ".........!@#$%^&().pdf". Am I missing something required to get unicode filenames?
    Thanks.

    You were right, the plugin was getting a char* from ASFileSysDisplayStringFromPath. I removed that and added this which seems to have fixed my problem:
    ASText pathText = ASTextNew();
    ASFileSysDisplayASTextFromPath(ASGetDefaultFileSys(), filePath, pathText);
    wchar_t *pathString = (wchar_t*)ASTextGetUnicode(pathText);
    Thank you!

  • Get input Filename

    Hi all,
    I need to get the name of the file i am currently reading from the sender system directory. I was thinking to send the filename as a tag to the output so that i can retrieve it at the output payload.
    If i can get the file name in some user defined function, i can map it to some output field.
    How can I get the filename using a function in XI

    Hi Rahul,
    Check out this blog by michal in which he has made a java function to retrieve the filename and map it to one of the xml tags...but to achieve this you should be working on SP14..
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Regards,
    Sushumna

  • How can I get a filename without the file extension?

    I using a JFileChooser to select and read a file. Now I want to get the filename without the file extension
    JFileChooser j = new JFileChooser;
    String file = j.getSelectedFile.getName();
    At the moment I get this result "file.dat". I need only the filename.....
    Thank you
    Thomas

    It's quite that.
    Here is the code to do that (and the method to get only the extension):
         public String getFileName(String text) {
              int ind = text.lastIndexOf(".");
              if(0<ind && ind<(text.length()-1)) {
                   return text.substring(0, ind);
              return(null);
         public String getFileExtension(String text) {
              int ind = text.lastIndexOf(".");
              if(0<ind && ind<(text.length()-1)) {
                   return text.substring(ind+1).toLowerCase();
              return(null);
         }(I used 0<ind instead of ind>0 because with the code formatting there is a bug with > )
    I hope this helps,
    Denis

  • Any way to get unique filename in "Save as" dialog?

    is there any kind of 3rd-party add-on or whatever that would give an option in the "Save as" dialog to simply make up a file name that would be unique in whatever folder it's trying to save to?
    Mike

    Kappy wrote:
    Do you mean to automatically insert a filename for you in the Save As: field of the dialog? Why is that needed when the field is usually always in a selected state so you can enter a filename of your choice? Maybe I don't quite understand what you are asking.
    ok. Suppose I am downloading files from an on-line web archive where many of the files have the same name. This means that for each one, I have to modify the name manually in the Save As: field, so they don't overwrite each other when I'm saving to a folder on my local hard drive. I certainly can enter new names for each, but it gets very tedious when there are a lot of files. I was wondering if there's any 3rd-party software that puts an extra option on there to automatically save with a unique name.
    thanks,
    Mike

  • Get dynamic filename in a Java Mapping (NOT UDF)

    Hi,
    we are using a Java Mapping step in XI (not UDF). We need to have access to the filename. In the File Adapter we set the message attributes and can see the filename value in the SXMB_MONI.
    We use the following code fragment to have access to the filename:
    Container container = new Context(new FunctionWrapper(0));
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String sourceFileName = conf.get(key);
    This doesn't work. We think the declaration of the container class is wrong. Does anybody have some information about using the dynamic attributes in Java Mappings?
    Thanks in advance
    Michael

    import com.sap.aii.mapping.api.*;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.HashMap;
    import java.util.Map;
    public class JavaProgram
        implements StreamTransformation
        public JavaProgram()
        public void setParameter(Map map)
            param = map;
            if(param == null)
                param = new HashMap();
        public void execute(InputStream inputstream, OutputStream outputstream)
            try
                DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get("DynamicConfiguration");
                DynamicConfigurationKey dynamicconfigurationkey = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
                String s = dynamicconfiguration.get(dynamicconfigurationkey);
             //Your logic
            catch(Throwable throwable)
                throwable.printStackTrace();
        private Map param;

Maybe you are looking for

  • IPod shows up in system profiler but not in /dev and disk utility

    Hi, I have a Problem with my iPod. It works perfectly when I connect it to other macs. Though on my mac it appears only in the system profiler, but not in itunes, /dev or diskutilities. Other USB devices are working correctly. I already reseted my ip

  • Report RFFMRC04

    Hello, Good Morning. We have a problem follow:     I used component ECC 6.0 with formal budget. run this transaction.: FM9Q FM9P FMBV Aftes executing this transaction tables BPJA this field WTJHR and WLJHR be zero. Running report without effectively,

  • Built-in HDD Password

    Hi, my laptop (Satellite Pro M10-S405 ) has rather recently started prompting me with a message "Built-in HDD Password =" at boot up. I've never set any passwords on the hard disk in the past, I have important data in the HDD. I would appreciate any

  • How to make shape style move slower?

    Hi. I've drawn a nice mask with dabs over an object, applied Light Streak 1 shape style to the mask so that the object draws on over time with a nice light stroke. But it happens too quickly. I would like the effect to happen slower, or possibly slow

  • FM for create Business partner.

    hii, i have the following code to create business partner. when i execute the code and enter the required data it gets executes successfully but i cannot see the created bp or partner-group or bp role in tcode bp. <removed by moderator> Moderator mes