How to get only the graphics path without graphics names?

Hi All,
I need to get only the graphics path without graphics names like 'd:\Images\' instead of 'd:\Images\abc.jpg' in JS.
Thanks,
Praveen

Something like this should get you close…
#target indesign
function main() {
     if (app.documents.length == 0) {
          alert('Please have an "Indesign" document before running this script.');
     return;
     docRef = app.activeDocument;
     with(docRef) {
          var x = rectangles[0].allGraphics[0].itemLink.filePath;
          var y = new File(x).parent.fsName;
          $.writeln(y);
main();

Similar Messages

  • How to get only the first result in extract function

    do you know how to get only the first element of the function extract.
    v_result := p_response.doc.extract('//'||p_name||'/child::text()').getstringval();
    if i have 5 responses like '100','100',100','200','200' e get '100100100200200' and i want only '100'.
    thanks in advance

    Two ways .....
    1. Use Javascript E4X instead ...there are nice functions for getting children of parents.
    2. Cycle through all of the form1.nodes and look for objects that have a className of "subform". For loops are useful for this task.
    Make sense?
    Paul

  • How to get only the date without the time in the footer of a printout?

    Is there a way to get only the date without the time in the footer of a printout?

    As far as I can tell, there's no built-in option to get the date printed without the time. It's hardcoded in a C++ file.
    As a workaround, you can enter custom text for the footer, but it would need to be updated every time the date changed. I can think of a couple ways to automate that:
    * An add-on (but I'm not aware of any add-on for this)
    * External process to push a new date into prefs.js, a settings file that stores your header/footer preferences, among others (but Firefox should be closed when you update this file, and it will be read when you restart)
    Not easy enough, I know.

  • How to get only the selected layer data?

    Hi All,
              I'm using dissolve sample plugin. I added two layers in photoshop both of different dimensions, say 1000 * 1000 & 2000 * 2000. Now I select the layer with 1000 * 1000 dimension and click on Dissolve plugin. The preview image what is shown in dissolve plugin dialog is not just the selected layer, but also some extra pixels around the selected layer.
    Do I need to set any flag for getting only selected layer data to display in preview?
    Also I need to get only the selected area in a particular layer. When I checked FilterRecordPtr, haveMask flag is TRUE if the part of the layer is selected. But how do I get only the part of the layer that is selected for displaying preview image?
    Please let me know if the description is not clear.
    Thanks,
    Dheeraj

    Thanks Tom Ruark for the response.
    That is exactly the same thing what I'm seeing.
    1.Is there a direct way to know the bounds of the layer without the transparency grid so that I can show only the layer?
    2. If I select an area of 50*50 within a layer(1000*1000) using Rectangular Marquee tool, then I want only that selected area to be shown in preview. For this there is a haveMask flag which indicates whether or not there is selection, but the selected bounds are not available. I'm currently calculating the bounds. I just wanted to know if Photoshop SDK has any field for getting the bounds?

  • How to get only the first level of nodes for a subform?

    How can we get only the first level of nodes of a subform?
    For ex:
    Form1
         SubForm1
              Text1
              Text2
              RadioButton1
         SubForm2
              Text1
              Text2
              RadioButton1
         SubForm3
              Text1
              Text2
                   SubForm31
                        RadioButton1
    In this heirarchy if we give Form1.nodes will refer to all nodes under the Form1 (SubForm1,Test1,Text2,RadioButton1,SubForm2,...SubForm31, RadioButton1 etc..)
    But is there any way that we can access only the first level of nodes of Form1 ie can we get only (SubForm1,SubForm2,SubForm3) for Form1 in any Way..?
    Thanks.

    Two ways .....
    1. Use Javascript E4X instead ...there are nice functions for getting children of parents.
    2. Cycle through all of the form1.nodes and look for objects that have a className of "subform". For loops are useful for this task.
    Make sense?
    Paul

  • How to get only the whole number omitting the decimals

    Hi Experts,
    I want to get only the whole number of a output field. For example  i am getting an output as 8.766 , i need only the value 8 .
    I checked by moving the values to integer field but i am getting the rounding value 9 .
    I want only the whole value 8.
    Please help me out..
    thanks & Regards.
    Reena..

    Hi Reena,
    Unfortunately when you assign a packed number to a character, numeric or even a packed no without a decimal value SAP does a internal conversion of rounding these value. So direct assignment would won't work for your case.
    You can use the following logic instead for getting the whole number.
    DATA : LV_VAR1 TYPE STRING,
                LV_VAR2 type p DECIMALS 3 value '8.766'.
    LV_VAR1 = lV_VAR2.   " LV_VAR1 would contain 8.766 without rounding.
    write  : LV_VAR1(1).   " LV_VAR1(1) contains 8 which you can assign to any target variable.
    I think there is no addition so as to avoid this internal rounding.
    Try and let me know if it works for you..
    Cheers
    Ajay

  • How to get only the filename and extension for a text item?

    Suppose there is a non-database text item called :myfilename
    :myfilename := 'C:\SomeFolder\SomePath\myfile.doc';
    I would like to get the file name only without the full path,
    i.e. myfile.doc
    and the file extension, i.e. 'doc', 'bat', 'java', 'xhtml' etc., i.e. the last few chars from the right to the period.
    Any help is welcome.

    Thanks for the hints.
    I defined the non-database Text Item called FULLFILENAME and another two text items called FILE_NAME, FILE_EXTENSION. The following can extract the file extension,
    select substr(:FULLFILENAME,instr(:FULLFILENAME,'.')+1) into :FILE_EXTENSION from dual;
    e.g.
    :FULLFILENAME := 'C:\MyFolder\AnotherFolder\file.doc';
    FILE_EXTENSION becomes 'doc'
    but I would also like to extract only the filename without path into FILE_NAME,
    i.e. file.doc
    Please give more hints. Thanks.

  • How to get only the record which is different by outer join

    Hi,
    how to get the values Existing in table A which are not existing in table B by using left outer join, In this example only the record '3' should display. thanks
    the requirementment is like
    Table A.Number Table B.Number
    1 1
    2 2
    3 4
    4 5
    output
    3

    SQL>  with a as (
    select 1 a from dual union all
    select 2 a from dual union all
    select 3 a from dual union all
    select 4 a from dual
    b as (
    select 1 a from dual union all
    select 2 a from dual union all
    select 4 a from dual union all
    select 5 a from dual
    select a.*
      from a left outer join b on (a.a = b.a)
    where b.a is null
             A
             3

  • How to get only the latest record in a folder

    Hi all,
    We have an OA SIT that is not a "standard" SIT in that it does not have the traditional Begin and End date. It only has an Effective date. Is there some way I can filter this table to only give me the latest record in the series? I know how to do this in SQL, but don't see how it would be possible in the EUL.
    We're trying to avoid creating database views, but at this point, I'm thinking it may be the easiest way to address this. Any other suggestions?
    Thanks in advance,
    Jewell

    Jewell.
    Of course I'm not going to mention that I have no idea what a 'standard' SIT is compared to your basic 'non-standard' SIT ... and I have to watch my spelling of such ... but however ...
    As you're most likely aware, in SQL you would get all the 'standard' SIT records first by going through the table. Then you'd go back through them all and find the most recent one.
    Because of this 2 table pass, I agree that just putting the SQL code in a custom folder (as you're not using views) would make the most sense.
    Russ

  • XML parsing - NodeList : how to get only the desired childs

    Hi
    my question is about parsing XML files. I use "getChildNodes()" method (from org.w3c.dom.Node class) to get in a NodeList all childs of node. Is there a method to get only desired child nodes? For example I want to get only node elements wtih tag "coordinate". Or alternatively, is there a method to exclude text node to be added to the NodeList? My problem is that depending on the xml is formatted, text node could be recognized and added from parser, and this causes problems with my parsing..
    thanks to all

    If you want to select nodes based on changing criteria, you should use XPath.
    If you have relatively fixed criteria, iterate over the nodes and pick out the ones that you want. For example:
      public static List<Element> getChildren(Element parent, String tagname) {
        List<Element> result = new ArrayList<Element>();
        NodeList children = parent.getChildNodes();
        for (int ii = 0 ; ii < children.getLength() ; ii++) {
          Node child = children.item(ii);
          if ((child.getNodeType() == Node.ELEMENT_NODE) && tagname.equals(child.getNodeName()) {
            result.add((Element)child);
        return result;
      }

  • HELP: How to get only the text of an element Node

    Hello
    I am using XPath for the following XML document:
    <Start>
    <User>
    <LoginName>abc</LoginName>
    <Password>qqq</Password>
    </User>
    <User>
    <LoginName>xyz</LoginName>
    <Password>ttt</Password>
    </User>
    </Start>
    Now I want to get the password for the LoginName = 'xyz'.
    The XPath I have written is:
    //User[LoginName='xyz']/Password[text()]"
    The result I get is:
    <Password>ttt</Password>
    But what I want is ONLY the password TEXT i.e the value of the password and NOT the complete node information. What Should I do with the Xpath string so that the result only gives: ttt
    Please help me with this as this has hold me now for quite a long time.
    Thanx.
    Arshad

    Use this method to get the text in Java
    public String getTextContents ( Node node )
    NodeList childNodes;
    StringBuffer contents = new StringBuffer();
    childNodes = node.getChildNodes();
    for(int i=0; i < childNodes.getLength(); i++ )
    if( childNodes.item(i).getNodeType() == Node.TEXT_NODE )
         contents.append(childNodes.item(i).getNodeValue());
    return contents.toString();
    }

  • How to get only the dc component of a dc signal with noise?

    I need to read a temperature value (a dc value). However signal has some noise in it, and i need to get it out. How can i make it? Using a low pass filter? Which one.? Is there any DC pass filter?

    First, depending on the sensor you are using and how you are making the measurement, make sure you use the appropriate VI from the palette:
    Data Acquisition -> Signal Conditioning
    Sure you can use most of the filters located in:
    Signal Processing -> Filters
    Create a constant from the "filter type" input and select "Lowpass".
    There is also an AC & DC estimator vi, located in:
    Signal Processing -> Measurement
    Always remember to check the shielding of your system.
    Finally, check the following at NI, which have good information on how to get rid of noise:
    DC voltage
    Regards;
    Enrique
    www.vartortech.com

  • How to get only the changed rows in h:dataTable

    Hi,
    I am very new in jsf technology.
    For our application, I need to process only the changed rows in the jsf datatable in managed bean.
    User may also enter new rows.We have to consider this also.
    Pls post ur suggession as soon as possible.This is urgent.This will be best if someone can post me some code snippets.
    Thanks
    -S

    As klejs said, set the valueChangeListener attribute to each of the input fields. Have a method in your backing bean which would
    1) get the index from the component id
    2) get the object and the above index from ArrayList
    3) check if the old Value is different from the new value. If yes, set some boolean flag in that object to true indicating that the row is modified.
    Sample code below. Please feel free to add checks if you need.
         public void updateDirtyFlag(ValueChangeEvent valueChangeEvent){
             if(valueChangeEvent.getOldValue()==null && valueChangeEvent.getNewValue()==null){
                     return;
             if(valueChangeEvent.getComponent().getId()==null){
                 return;
          //Extract the index from the component id in the getId method
             int idVal=getId(valueChangeEvent.getComponent().getClientId(FacesContext.getCurrentInstance()));
             ArrayList dataList=getData(); // data from session or request scope
              if((valueChangeEvent.getOldValue()==null && valueChangeEvent.getNewValue()!=null)        
                     || (valueChangeEvent.getOldValue()!=null && valueChangeEvent.getNewValue()==null)){
                 if(dataList!=null && idVal<dataList.size() && idVal>-1){
                     YourBaseValueObject pojo=(YourBaseValueObject)dataList.get(idVal);
                     pojo.setUpdateFlag(true);
             else if(valueChangeEvent.getOldValue()!=null && valueChangeEvent.getNewValue()!=null && !valueChangeEvent.getOldValue().equals(valueChangeEvent.getNewValue())){
                 if(dataList!=null && idVal<dataList.size() && idVal>-1){
                     YourBaseValueObject pojo=(YourBaseValueObject)dataList.get(idVal);
                     pojo.setUpdateFlag(true);
         }HTH.
    Karthik

  • How to get only the CD ROM / DVD ROM units

    Hy to everybody,
    I have a little problem and i hope someone could help me.
    The problem is like this i've whant to list all the CD/DVD units, not all the units.
    For exemple if i have C: D: E: G: and C: and D: are hdd and E: it's a CD unit and G: it's a DVD unit i whant to get only D: and G: .
    I've tried with File.listRoots().
    but this gives me all the units. It's there a way to specify the type of the units i whant to get?
    Thanks for your help.

    Some systems can mount a file system against a file containing an iso image.
    Does such a file system qualify as a CD/DVD unit or not?
    If a CD/DVD drive is shared by another box and it is being accessed as a network drive, does it qualify as a CD/DVD unit?

  • SQL question - how to get only the leafs

    i have a table of departments
    create table departments (
      dept   number ,
      father number
    )this is the data
    1
    1/2
    1/2/4
    1/2/4/6
    1/2/4/7
    1/2/4/8
    1/3
    1/3/5
    1/3/9given a department number i need only the leafs (the lowest member in the hierarchy).
    for dept 2 i need 6, 7, 8
    for dept 3 i need 5 , 9
    for dept 5 i need 5
    this is my query
    select dept
    from departments
    where connect_by_isleaf = 1
    start with father = :X
    connect by prior dept = father;this query will work only if :X is not a leaf. for 2 and 3 this query will work but for 5 it will return nothing (since connect_by_isleaf is 0 if the department apears in the start with clause).
    thanks !

    try
    select dept
    from departments
    where connect_by_isleaf = 1
    start with dept = :X
    connect by prior dept = father;Dang very late
    Message was edited by:
    Versatile

Maybe you are looking for