app.activeDocument.activeDataset.name

Hello

I have set up an action that I use for my batch process. I have to iterate over the [i] data sets that have unique names. I am trying to determine the name of the current index [i] data sets. I am able to read the name like this:

Alert(App.activeDocument.dataSets[0].) (Name) / / It only reads the name of the dataset to [0] for each iteration. myset_0, myset_0, myset_0, myset_0, myset_0, myset_0, myset_0...

The problem is that what I call for the batch using the dataset object. I can't delete the dataset from scratch, because she's going to change the length and spoil the batch.

I want to do it like this:

Alert (app.activeDocument.activeDataset.name); myset_0, myset_1, myset_2, myset_3, myset_4, et_5, myset_6 mys...

but I get undefined.

I don't know what the problem with this syntax:

app.activeDocument.activeDataset.name

Thank you

Aubrey

Try:

app.activeDocument.activeDataSet.name;

Tags: Illustrator

Similar Questions

  • Or is the error: app.activeDocument.saveAs (saveFile, saveOptions, true, Extension.LOWERCASE);

    Hello

    I have a script that works on Mac, I pass it on PC, and here he made a mistake with this message "a general photoshop error occurred. "This is may not be available in this version of photoshop.

    This is my function:

    Function to save files

    function SaveFile() {}

    var app.activeDocument.name = docRef;

    saveFile = new File(destinationFolder+"//"+docRef);

    Alert (SaveFile);

    saveOptions = new JPEGSaveOptions();

    saveOptions.embedColorProfile = true;

    saveOptions.formatOptions = FormatOptions.OPTIMIZEDBASELINE;

    saveOptions.matte = MatteType.NONE;

    saveOptions.quality = 10;

    app.activeDocument.saveAs (saveFile, saveOptions, true, Extension.LOWERCASE);

    app.activeDocument.close (SaveOptions.DONOTSAVECHANGES)

    }

    Can someone help me?

    Thank you

    "saveFile" is defined on line 14

  • [JS CS3, win] Saving InDesign using app.activeDocument.save

    Hello.

    I have problems saving a document in InDesign using Javascript.

    My goal is to have a box in the document where I type the name of the file and the path where I want to save the InDesign file (eventually it will be generated from a datamerge).

    Then, I want to run a script that will read the contents of the box and then save the document to the file name or location.

    At the moment I have:

    SaveText.jsx
    A JavaScript InDesign CS3
    //
    Saves the document in the provided path

    get the content of the FileNameBox box on the document
    var varFileName = app.activeDocument.textFrames.item("FileNameBox").contents;
    Save now
    app.activeDocument.save ("/" + varFileName + ".indd");

    Alert (app.activeDocument.filePath);

    When I run the script (with 'Hello' in the FileNameBox) file changes its name on the top bar of InDesign to "Hello.indd", but (when I run the commented warning at the end) the file is not actually save anywhere.

    If I close InDesign, then open it the file is listed under 'Open recent' on the menu, but clicking on it does nothing - even when the file does not exist.

    Does anyone have ideas to help me to tear my hair out?

    Where is my save file? (Or, if not, how can I do save!).

    Thanks in advance for any help you can offer.

    var myFolder = new Folder ("~/Desktop/Test");
    If (! myFolder.exist) myFolder.create ();
    var varFileName = app.activeDocument.textFrames.item("FileNameBox").contents;
    app.activeDocument.save (myFolder.fsName + "\" + varFileName + ".indd");
    Alert (App.activeDocument.FilePath);

  • Is the result of app.activeDocument.metadataPreferences a XMPMeta object?

    Hello again

    Hope this isn't a stupid question.

    I wondered if the result of

    app.activeDocument.metadataPreferences;

    is an object of XMPMeta according to "JavaScript Tools Guide.

    I would say yes, because I found examples where the previous statement is followed

    myDocXMP.setProperty (destNamespace, destNodeName, nodeValue);

    But I would also say no, because when I'm looking for

    myDocXMP.deleteProperty (destNamespace, 'CreatorTool');

    ExtendScript Toolkit, I get an error message saying "myDocXMP.deleteProperty is not a function".

    More I read, the more I get confused. Can you help me find a source of information for beginners? Thank you very much.

    Giordano

    Hello

    metadatapreferences does not have a method deleteProperty()

    Take a look: http://jongware.mit.edu/idcsjs5.5/pc_MetadataPreference.html

    These methods belong to lib: AdobeXMPScript.

    It is not as easy to manage as well. Have you tried another tool like exiftool commadline...

  • app.activeDocument.revert ();

    I know that this will be easy, but it drives me crazy!

    app.activeDocument.revert ();

    give me a cancel / Restore dialog box

    I just want back. Don't ask me if want to come back.


    Help, please.

    Thank you

    Tell InDesign to shut up and do what it is told. (After that, however, you can find out if she has something to complain.)

    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
    app.activeDocument.revert();
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
    
  • App without a name appears in the settings but not on the screen of the ipad

    I had problem with wifi dying on me due to unforeseen circumstances recently. Tonight, while checking on ipad, I found this afeter by pressing "set" if I scroll this page on the left there is the lift of the applications installed on the iPad. The first application I have on it is not a name but if had authorized access to the location, mobile data and so on

    I want to get rid of this unknown app but since it does not appear on the screen of my ipad, I can't kill it.e!

    Help please! Fear that this could be the virus any.

    This is the logo of the app...

  • ADF mobile - app image and name in the iphone

    Hi all

    How to display the custom in the iphone app icon and also do where I put the name of the application that appears under the icon of the iphone app please?

    Thank you

    Hello

    the name is set in the adfmf configuration file - application.xml. For icons, choose

    Application--> Application--> Deployment Properties--> New--> ADF Mobile for iOS.  Expand the node 'ios Options' and you will see the settings app icons. Then, you deploy the application using the deployment file later.

    Frank

  • How to create an app with space name?

    Hi all

    How to create an application with the space, for example "Hello Word" name When I run my Simulator, I got ' Hello$ 20World "instead. I use the plugin for eclipse for development. I can see the Application descriptor for my application, and it shows the thin space. I tried to change the Blackberry project properties tab generate file output name, but it doesn't help in any way. Please advise...

    Goto Blackberry project properties

    Click the general tab

    Write in title = "Hello World".

    and you can see your title of the modified project

    I hope that you ask for it only!

  • How does NOT save a file name extension?

    Hey everybody!

    I have a script for Photoshop > > extension a bit > > I click on a button and the script save the .jpg file into a png (with extra stuff "of course") file in the same folder.

    Works like a charm...

    But when it comes to the original file name: exemple.jpg

    I get this png file name: example.jpg.png

    I save the file name and path with this code:

    filePath = app.activeDocument.path + '/' + app.activeDocument.name; + '.png';
    

    The goal is to get rid of the section '.jpg' the new file name.

    I tried to save file name in a variable and then reduce the number of characters or even save it without the extension, but no luck.

    any ideas? !

    Thank you!

    var name = app.activeDocument.name;
    If (Name.indexOf(".")! = - 1) Name = Name.substr (0, Name.lastIndexOf("."));
    filePath = app.activeDocument.path + "/" + Name + ".png";

  • Set a variable to the selected path name Photoshop

    I am trying to assign the name of the currently selected Photoshop (like, normal) route to a variable.

    I can do it for an artLayer as follows app.activeDocument.activeLayer.name; but I searched the web a way to isolate the active path.

    Could someone help with this?

    Thank you

    Limey

    Ah, I misunderstood.

    This might help:

    determine the path selected, set to day 09.2015.

    function selectedPath2015 () {}

    try {}

    Var ref = new ActionReference();

    ref.putProperty (stringIDToTypeID ("property"), stringIDToTypeID ("targetPathIndex"));

    ref.putEnumerated (charIDToTypeID ("Dcmn"), charIDToTypeID ("Ordn"), charIDToTypeID ("Trgt"));

    var docDesc = executeActionGet (ref);

    return app.activeDocument.pathItems [docDesc.getInteger (stringIDToTypeID ("targetPathIndex"))]

    }

    catch (e) {return undefined}

    };

  • 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

  • How to get the ID of the layer name layer?

    Hello everyone.

    Trouble with the implementation of a small script.

    I want to add to each of the selected layers in the Document a new layer with the image, make sure that the top of each layer.

    I think what I need:

    1. create a table of the layers selected by the user (necessarily by name)

    2. Select the image;

    3. pass by the table to create a layer, put in new picture selected layer and move the table above this layer.

    Found an example where the table is created on the index, but in my case it's not that - after that each addition of a new layer index is changes. How can I get the index of the layer by name?

    Andy_Bat1 wrote:

    But if I understand correctly, I need to know the ID or Index of the layer?

    No, you need a layer object (or layerSet). You can make reference to an object layer in several ways. The excerpt you posted has two, one is owned by activeLayer and the second is by index. You can also make a reference using the name of the layer and some methods like ArtLayers.add () return an object layer. The DOM is not an ID of the layer property.

    app.activeDocument.activeLayer.move (activeDocument.artLayers.getByName ('top'), ElementPlace ment. PLACEBEFORE);

    app.activeDocument.activeLayer.name = 'new top ";

  • Get the name of the folder after parent.

    Hi forum.

    I need a big help on your part.

    If I could get the name of the folder that is between the office and the indesign files where it saved ls...

    for example.

    /Users/wleastudio/Desktop/rantacacb.indd.

    I need to get the file name selected in red and alert...

    If it isn't immediately on desktop I can do easily alert as below...

    name = Folder("/Users/wleastudio/Desktop/");

    If (app.activeDocument.filePath == name.path + "/" + name.name) {}

    Alert ("the document is in the office"), out;

    }

    If the document is saved in a folder on your desktop, that's the problem, I find it difficult to find the name of the folder and get alert...

    /Users/wleastudio/Desktop/rantacacb.indd.

    Thanks in advance

    Hello

    artCraft2 wrote:

    ...

    If it isn't immediately on desktop I can do easily alert as below...

    ...

    It's always all right way:

    the last folder name: app.activeDocument.filePath.parent.name

    last folder: app.activeDocument.filePath.parent

    You could step using parent.parent and so on...

    Jarek

  • change the name of the file using GREP

    Hello

    I try to get these lines of code to change the name of file saving;

    from: zAlcatraz

    to: HAlcatraz

    {if (myDocName.IndexOf ('z')! =-1)}

    var myRegularExpression = / \ < z/IM

    myDocName = myDocName.replace (myRegularExpression, 'H');

    }

    I try to target just the first z in front of each file name, but can not get the correct grep.

    Any thoughts?

    Thanks in advance,

    GR

    Vel code will replace all instances of lowercase 'z' by 'H' capital - even those in the path of the file.

    Better try this:

    myDocName = app.activeDocument.fullName.path+'/'+app.activeDocument.fullName.name.replace (/ ^ z/i, 'H');

    (Looking for the GREP code probably is ' ^'-beginning of the 'line', in this case equal the beginning of the string.)

  • Name an object - Simple? JavaScript/Windows

    Hey all!

    And again, I have a problem in a fairly simple thing. I didn't look for a code looking for the Style of paragraph as i want to, so far no problem here. I fount the point, swapped to the selection tool so it can change the selection of the text instead of the text box and then I want to name this object. All this, but I can't do it! Hahahaha

    Take a look:

    // LOCALIZA O PARAGRAPH STYLE DA REFERÊNCIA
    var oDoc = app.activeDocument;
    
    //First loop through all stories then through all paragraphs in each story
    for(n=0; n< oDoc.stories.length;n++){
        for(i=0;i<oDoc.stories[n].paragraphs.length;i++){
    
            // If paragraph style is "Silkeborg" then select paragraph and insert "S " before
            if  (oDoc.stories[n].paragraphs[i].appliedParagraphStyle.name == "referencia") {
                oDoc.stories[n].paragraphs[i].select();
                }
            }
        }
    
    // SELECIONA O BOX
    app.toolBoxTools.currentTool = UITools.SELECTION_TOOL;
    
    // NOMEIA
    app.activeDocument.selection.name= "Modelo";
    

    He's looking for, if found, change of selection tool, but just will not mention the subject. What I am doing wrong?

    Here is another script I found that the names of the object of the same object tag:

    var myDocItems = app.activeDocument.allPageItems;
    
    for(var i = 0; i < myDocItems.length; i++)
      if(!myDocItems[i].name)
        myDocItems[i].name = myDocItems[i].label;
    

    And this one work, but this object that looking at my script is not a label, so I can't use it.

    Any tips?

    Thank you guys! CyA!

    'Sélection' is always a table, you cannot use

    .. Selection.Name =...

    You must use

    .. selection [0] .name =...

    Second, "a label" is not a problem :-) All managers of related texts have a label (and usually it is empty). I don't know if you should use "name" or "label" in this case - I think that the advantage of the 'name' in CS5.5 he's showin in the layers panel.

    Third (!), there are 1. no need to "switch to the selection tool" to set a selection and or use app.select.  JavaScript allows instant access to everything, then you can simply define the name of the outside frame of any paragraph using something like

    oDoc.stories [i] .paragraphs [n] .parentTextFrames [0] .name =...

    Note that a single paragraph can have more than a single "parent text block" - this paragraph maystart in one and end in another.

Maybe you are looking for