Is it possible to get the name of the folder that contains the current document?

Hi all!


I know how to get the name of the active document


app.activeDocument.name;


but I was wondering if you could also get the name of the folder that contains the current document. Not sure if this is possible or not, so I thought I'd ask, if so it save me a lot of time.


Thanks in advance!

Hi djbgraphicdesign,

does this work for you?

if (app.activeDocument.saved){
alert(app.activeDocument.path.name);
}

Have fun

Tags: Illustrator

Similar Questions

  • Is it possible to get the currently selected clipitem?

    Heya folk from Adobe,

    Is it possible to get the clipItem currently selected in the active sequence, something like this:

    app.enableQE ();

    project var = qe.project;

    Project.init)

    curSeq = project.getActiveSequence ();

    curSeq.getSelected () # does not exist, I'm looking for a way to do this

    It is a high priority for me.

    Thank you!

    Raphael

    I appreciate your optimism about what is in the API, but it only no concept of selection (other than, 'what sequence is currently active").

    I'll add your vote to the feature request (already very popular), "to provide current information of project selection and sequence.

  • Is it possible to get the current selection?

    catalogue: getTargetPhotos () returns an array of selection photos or film if nothing is selected. catalogue: getTargetPhoto() returns only non-neant if something is more selected.

    Is it possible to get a real choice?

    The methods of selection are indeed confusing.  This function returns the current selection, or empty if there is no selection in the array:

    getSelection () function

    If catalog: getTargetPhoto () then

    back catalogue: getTargetPhotos)

    on the other

    return {}

    end

    end

  • Is it possible to get the current height of a container?

    You can get min, max heights and favorite, but none of these really reflect the actual height, currently used containers, especially when the container contains scalable text (which can get bigger or smaller fonts in display settings settings)

    Is there a way to get a container currently used height?

    Fix LayoutUpdateHandler to follow its current dimensions. http://developer.BlackBerry.com/Cascades/reference/bb__cascades__layoutupdatehandler.html

  • get the current event (name) of a field - possible / how to?

    Hello

    I wonder if it is possible to get the name of a field as event:

    (form.pag1.mytextfield::enter - JavaScript, client)

    var eventname = this.MagicJSfunction();
    

    It is of course possible to get the current name of the event with:

    (form.pag1.mytextfield::enter - JavaScript, client)

    var eventname = event.name; 

    It's a shame it's always = 'Focus' wherever I use it (form.pag1.mytextfield::ENTER - JavaScript, client) (form.pag1.mytextfield::EXIT - JavaScript, client)

    (form.pag1.mytextfield::enter - JavaScript, client)

    my_scripting_obj.my_set_design_function(this, eventname);

    Reason:

    I use to change the structure of a field in realtion to his event in my script object. By calling the function of my script object, I'd use some copy/paste.

    I have more than 120 field where this function must be called to enter and exit the event.

    Hello

    Does that help? http://assure.ly/h8ZLr5.

    In this case, I call the function entry and exit of the events of each field.

    Niall

  • Get the current language settings in the Custom Validation rule?

    Hello

    I read the book from Guide JDevelopers
    "In 26.9' custom application Validation rules.
    I ran the example to create custom Validation rules
    I ran my validation rule for English and Italian language using 'Message Bundles'
    I had EntityImplMsgBundle and EntityImplMsgBundle_it for the Italian language
    The Question is:
    Is it possible to get the current settings of the language used "get of in my custom validation class?
    I need to know if the current language is 'in' or 'it '.

    When I test my Applicaton of Module I can choose the configuration name: English EntityLocal and EntityLocalIT for the Italian language
    Can I access this validation custome bean?

    Kind regards.

    Hello

    Yes, you can access the local current in your validation rule by accessing the current session through the source of the entity object DBTransaction object. This is done by calling:

    ((EntityImpl)valCtx.getSource()).getDBTransaction().getSession().getLocale()
    

    HTH,
    Patrik

  • How can I get the current state "onto the Pixels?

    Hello community,

    Here's the function that creates a switch that handles "snap to Pixels":

    index.html:

    <div id="STP_input" onclick="switchOnOff(this)">
         ...
    </div>
    

    main.js:

    $("#STP_input").click(function () {
         var a = switchOnOff(this);
         if (a) {
              csInterface.evalScript('switchSTP(true)');
         } else {
              csInterface.evalScript('switchSTP(false)');
         }
    });
    

    HostScript.jsx:

    function switchSTP(checkBTN) {
        'use strict';
        
        var condition;
        if (checkBTN === true) {
            condition = true;
        } else {
            condition = false;
        }
    
        var idsetd = charIDToTypeID( "setd" );
        var desc26 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref6 = new ActionReference();
            var idPrpr = charIDToTypeID( "Prpr" );
            var idtoolsPreferences = stringIDToTypeID( "toolsPreferences" );
            ref6.putProperty( idPrpr, idtoolsPreferences );
            var idcapp = charIDToTypeID( "capp" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref6.putEnumerated( idcapp, idOrdn, idTrgt );
        desc26.putReference( idnull, ref6 );
        var idT = charIDToTypeID( "T   " );
            var desc27 = new ActionDescriptor();
            var idtransformsSnapToPixels = stringIDToTypeID( "transformsSnapToPixels" );
            desc27.putBoolean( idtransformsSnapToPixels, condition );
        var idtoolsPreferences = stringIDToTypeID( "toolsPreferences" );
        desc26.putObject( idT, idtoolsPreferences, desc27 );
        executeAction( idsetd, desc26, DialogModes.NO );
    
        return;
    }
    

    But when I hide the Panel and show once again, that the switch back to the default state, turn on my Panel, not "hook to Pixels" PS settings setting. Is it possible to get the current status 'Hang the pixels' setting? How?

    Best regards.

    See post 8 in this thread:

    Re: Need someone to update or create script: "snap to grid of pixels.

  • Is it possible to get the name of the tool selected from a script?

    Hello

    Is it possible to get the name of the tool currently selected from a script?

    I found this:

    https://forums.adobe.com/thread/579195

    https://forums.adobe.com/thread/2161923

    But these works in Photoshop... So, it is possible to get the name of the tool currently selected in InDesign? Is there a universal method that will work in other applications?

    I think that there is a toolBoxTools, app.toolBoxTools...

    P.

  • Is it possible to get clip names and additional descriptions (and other metadata) in a report? The number, .xls or some other document available?

    I have about 12 tablespoons of images recorded on several projects. Each clip has a description added to it. I'm trying to find a way to search for a specific content easier. Since so much information was laboriously on slot form of description of metadata, it would be great to be able to use it. Which brings me to the question -

    Is it possible to get clip names and additional descriptions (and other metadata) in a report? The number, .xls or some other document available?

    Thank you!

    Karim.

    one way is to highlight all the media/bins in the project Panel and from the menu, export the batch list. This will create a .csv text file.

    There is also this option in another post, but do not know how it works. First Pro CC - how can I export metadata custom in Excel?

  • Is it possible to get the layer, layerset and layer with status layerset...!

    Hello world!

    Is it possible to get the layer, layerset and layer with the status layerset. Because I met a big problem out of it.

    I have a single PS document which is contain the collection of layer, layer with layer games collection. I need apply the function for each layer and layers and each layer games with of layerset.

    I also tried a code, but its error getting. Please help me out of this code...

    -yajiv

    #target photoshop

    app.bringToFront ();

    level of $= 2;

    var app.activeDocument = docRef;

    Journal of the var ="";

    var x = 0;

    var n = number (docRef.layers.length) - 1;

    for (i = 0; i < n; i ++) {}

    var tm = String (docRef.layers [i]);

    var isLayer = tm.lastIndexOf ("ArtLayer");

    var isLayerSet = tm.lastIndexOf ("LayerSet");

    {if(isLayer!=-1)}

    Check_LayerStructure (DocRef.Layers [i], 'Layer');

    }

    {if(isLayerSet!=-1)}

    Check_LayerStructure (DocRef.layerSets, "LayerSets");

    x = x + 1;

    }

    }

    function Check_LayerStructure (objLayer, objflag, x) {------}

    {if(objflag=="Layer")}

    LayetStructure (objLayer, objLayer.name, BlendMode.NORMAL, 100, 100, 0, true, 'Layer');

    }

    else {if(objflag=="LayerSets")

    LayetStructure (objLayer [x] objLayer [x] .name, BlendMode.PASSTHROUGH, 100, 100, 1, true, 'together');

    m = Number (objLayer [x] .layers. Length)

    for (j = 0; j < m; j ++) {}

    var tm = String (objLayer [x] .layers [j]);

    var isLayer = tm.lastIndexOf ("ArtLayer");

    var isLayerSet = tm.lastIndexOf ("LayerSet");

    {if(isLayer!=-1)}

    Check_LayerStructure (objLayer [x]. Layers [j], 'Layer');

    }

    {if(isLayerSet!=-1)}

    Check_LayerStructure (objLayer [x] .layerSets, "LayerSets", x);

    }

    } / / Loop Layerset

    } / / I loop For

    } //Function loop

    function LayetStructure(layerRef,L,bMode,Opt,fillOpt,S,layVisible,Lref) {}

    {if(layerRef.BlendMode!=bMode)}

    If (confirm (L + Lref + "belend mode was bad...!)) \n"+"do you want to change...? »)) {

    layerRef.blendMode = bMode;

    Journal = Journal + "-" + L + Lref + "belend mode has been changed...! \n\n ";

    e = 1;

    }

    }

    {if(layerRef.Opacity!=opt)}

    If (confirm (L + Lref + ' opacity has been "+ Math.round (layerRef.opacity) +"%...! ")) \n"+"do you want to change...? »)) {

    layerRef.opacity = Opt;

    Journal = Journal + "-" + L + Lref + ' opacity was changed to 100...! \n\n ";

    e = 1;

    }

    }

    If (layerRef.fillOpacity! = fillOpt & & S == 0) {}

    If (confirm (L + Lref + ' Fill has been "+ Math.round (layerRef.fillOpacity) +"%...! ")) \n"+"do you want to change...? »)) {

    layerRef.fillOpacity = fillOpt;

    Journal = Journal + "-" + L + Lref + ' fill has been changed to 100...! \n\n ";

    e = 1;

    }

    }

    {if(layerRef.visible!=layVisible)}

    If (L + Lref + ' left eye...! ") \n"+"do you want to change...? ») {

    layerRef.visible = layVisible;

    Journal = Journal + "-" + L + Lref + ' eye was turn on...! \n\n ";

    e = 1;

    }

    }

    }

    Code of responsible for the action would naturally faster, but if you should be more comfortable with the DOM code, it could be useful to you.

    #target photoshop

    var theLayers = collectLayers (app.activeDocument, []);

    Alert (theLayers.join ("\n"));

    function to collect all the layers.

    function collectLayers (theParent, allLayers) {}

    If (! allLayers) {var allLayers = new Array}

    else {};

    the number of var theParent.layers.length = - 1;

    for (var m = number; m > = 0; m-) {}

    var theLayer = theParent.layers [m];

    apply the function of games of layers;

    If (theLayer.typename == "ArtLayer") {}

    allLayers.push ([theLayer, theLayer.blendMode, theLayer.opacity, theLayer.fillOpacity])

    }

    else {}

    allLayers = (collectLayers (theLayer, allLayers))

    This line includes layer groups;

    allLayers.push ([theLayer, theLayer.blendMode, theLayer.opacity, theLayer.fillOpacity]);

    }

    };

    return allLayers

    };

  • is it possible to get the EPS encoding (IE.. BINARY, ASCII, ASCII85)

    Hello world

    is it possible to get the ASCII85 encoding BINARY, ASCII, EPS, JPEG (low)...

    Thanks in advance.

    1.jpg

    -yajiv

    The format of Photoshop EPS files is partially documented here:

    http://www.Adobe.com/devnet-apps/Photoshop/fileformatashtml/#50577413_pgfId-1035096

    Photoshop includes a comment in the EPS so that it is able to read, it writes files insert it again. Third-party programs that write files EPS pixel-based can include this comment in EPS files, so that Photoshop can read their files.

    The comment must follow immediately after the % block of comments at the beginning of the file. The comment is:

    %ImageData: ""

    : Width of the image in pixels.

    : Height of the image in pixels.

    : Number of bits per channel. Must be 1 or 8.

    : Picture mode. Image bitmap/levels of gray = 1; Lab = 2; RGB = 3; CMYK = 4.

    : Number of another string in the file store. Ignored when reading. Photoshop uses this to include a grayscale image that is printed on PostScript printers without colors.

    : Number of bytes per line per channel. Will be 1 or formula (see below):

    1 = data are interleaved.

    (columns * depth + 7) / 8 = data are stored in line-interlaced format, or there is only a single channel.

    :

    1 = data in binary format.

    2 = data in hexadecimal ascii format.

    : PostScript the line immediately preceding the image data. This entire line should not occur elsewhere in the PostScript header code, but it can happen to part of a line.

    In addition, some information about other values of can be found here:

    http://Python.6.X6.Nabble.com/correctly-determine-image-size-of-a-Photoshop-EPS-td2096786. HTML

    1 - binary

    2 - ascii

    3 - jpeg low quality

    4 - jpeg medium quality

    5 - jpeg quality

    6 - jpeg maximum quality

    7 - ascii85

    This is a test script using this information:

    function main ()
    {
        function isPhotoshopEPSFile (f)
        {
            return (f.type === 'EPSF') || f.name.match (/\.eps$/i);
        }
        var epsFilter =
            (File.fs === "Macintosh") ?
                function (f) { return (f instanceof Folder) || isPhotoshopEPSFile (f) } :
                "Photoshop EPS Files:*.eps,All Files:*.*";
        var epsFile = File.openDialog ("Open Photoshop EPS file:", epsFilter);
        if (epsFile)
        {
            if (epsFile.open ("r"))
            {
                while (!epsFile.eof)
                {
                    var line = epsFile.readln ();
                    var found = line.match (/^%ImageData:\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/);
                    if (found)
                    {
                        var dataFormatIndex = found[7];
                        var dataFormats =
                        [
                            "Binary",
                            "ASCII",
                            "JPEG (low quality)",
                            "JPEG (medium quality)",
                            "JPEG (high quality)",
                            "JPEG (maximum quality)",
                            "ASCII85"
                        ];
                        alert (dataFormats[dataFormatIndex - 1]);
                        break;
                    }
                }
                epsFile.close ();
            }
        }
    }
    main ();
    

    HTH,

    Domestic-

  • Is it possible to get the total value of column and set to another area

    Hello

    Is it possible to get the total value of a particular column, and assign this value to another discipline?

    How to do this?

    Thanks in advance,
    SAN

    Hi SAM,

    If your controller class throw this message it means that it works very well. Follow these steps, I hope this will solve your problem.

    1 check the following

    OAApplicationModule am = pageContext.getApplicationModule (webBean);
    OAViewObject ratvo = (OAViewObject) am.findViewObject("*CompetenceElementsVO*"); It should be the name of the instance instead of the name Physics vo vo.
    OAViewObject valuevo = (OAViewObject) am.findViewObject("*PerRatingLevelsVO*");

    2. extend this controller class that is associated with this region.

    I hope it will work now.

    Haroon.

  • Get the current name of the page without the aid of a bean

    Hello, everyone!

    If I would get the current name of the page to a page, I'd do something like this:
    #{bean.currentPageName}
    @SessionScoped
    @Named
    public class Bean
    {
        public String getCurrentPageName()
        {
            return FacesContext.getCurrentInstance().getViewRoot().getViewId();
        }
    }
    But my question is: is it possible to get the name of the current page directly from the xhtml page without using a bean? Is it something related to it or information available to the page itself? If so, how can I access it?

    Thank you in advance.

    Marcos

    Use the same semantics in the page:

    #{facesContext.viewRoot.viewId}
    
  • STOR. E TV can play some formats - is it possible to get the firmware update?

    Is it possible to get the update of firmware for STOR. E TV, because this product cannot read many formats.
    I woud would better update of firmware for video - AVI (Xvid, AVC, MPEG1/2/4), MPG/MPEG, VOB, MKV (h.264, x.264, AVC, MPEG1/2/4, VC - 1), TS/TP/M2T (MPEG1/2/4, AVC, VC-1), MP4/MOV (MPEG4, h.264), M2TS, WMV9.

    Can someone REPAIR THIS TOSHIBA in the FUTURE?

    Hello

    It would be always great if a device would be supports all possible formats
    Allows how such as firmware updates or similar would be released
    Who knows what guys are going to do in the future, we'll see.

  • Qosmio G30-163: is it possible to get the HDMI by component

    Hello

    It seems that I'll be stuck with my Qosmio back to its own screen whenever I turn off my LCD TV. So what to do?
    I have a box of multiple component entry from another manufacturer. Is it possible to get the HDMI / component?

    While I listen to my signal through that?
    The only other option is for me to leave my TV in all of time...

    Hello

    Hmm, to my knowledge the HDMI / component is not possible.
    The HDMI-DVI adapter is known to me. Also the "cable DVI-component.

    In any case, I don't think that it is a large and serious issue. You can use the FN + F5 combination to toggle the display if the image switches to the internal display of the laptop!

    Best regards

    Goodbye ;)

Maybe you are looking for