New Precomposer in AE CC function via script

As we know new AE CC has got awesome checkbox called "Adjust composition duration to the time span of the selected layers".
Default setup in scripting guide is:
[object LayerCollection].precompose(array, string, [bool]);
But it doesn`t work with a new checkbox.
So how to operate with a new checkbox via script?
Thanks for reading.

I found that precomp function doesn`t work with app.project.activeItem.selectedLayers;
So here is the final touch that works with selected layers.
Cheers
function precompLayer() {
var myComp = app.project.activeItem;
if(myComp == null){alert("Please, select your composition"); return false;}
   var selectLayers = app.project.activeItem.selectedLayers; // выбранные
      if(selectLayers.length <1 ){alert("Please, select layers"); return false;}
   myLayers = [];      // precomp function works only with layers indexes, so array should contain layers indexes
        for (var l = 0; l< selectLayers.length; l++){
            myLayers.push(selectLayers[l].index);            // new array with layers indexes
var precompIndices = myLayers;  //change this to customize
        var precompName = "new_comp";  //change this to customize
        var parentComp = app.project.activeItem;  //change this to customize
        clearOutput();
        writeLn("Creating precompose");
        app.beginUndoGroup("Precompose");
        var Inpoint = 0;
        var Outpoint = 0;
        var precomp = parentComp.layers.precompose(precompIndices, precompName, true);    
        var adjustStartTime = precomp.duration, newCompDuration = 0;
        writeLn(precomp.layers.length+" layers in procompose");
        for(var i=1; i<=precomp.layers.length; i++) {
            var layer = precomp.layer(i);
            (Inpoint > layer.inPoint) ? Inpoint = layer.inPoint : Inpoint;                  // begin of precomp
            (Outpoint < layer.outPoint) ? Outpoint = layer.outPoint : Outpoint;       // end of precomp
            var duration = Outpoint - Inpoint;
            adjustStartTime = adjustStartTime > layer.inPoint ? layer.inPoint : adjustStartTime;
            newCompDuration = newCompDuration < duration? duration : newCompDuration;
            writeLn("New duration = "+newCompDuration);
        for(var i=1; i<=precomp.layers.length; i++) {
            precomp.layer(i).startTime -= adjustStartTime;
        precomp.duration = newCompDuration;
        parentComp.layer(precompName).startTime = adjustStartTime;
        app.endUndoGroup();
writeLn("Done!");
precompLayer();

Similar Messages

  • Set filename of printed PDF via script

    Hi folks!
    I have a little problem with generating a PDF. First my Workflow:
    I have a InDesign document with 6 pages. This document is merged with a databasefile containing 100 records. After merging it, we have to generate a PDF file. This PDF file is opened within acrobat. Within the document, I'm searching for an ID each record has so I can split the document to 100 files (each with 6 pages) and name it by the ID I found.
    The script within Acrobat is finished and working. I thought, the InDesign script is finished ,too. But I was wrong -.-
    I merged the databasefile with the document and exported it as PDF. But after exporting, we noticed that the script within Acrobat isn't finding the adressheader where the ID is in. The script only noticed the text after that header. The result is, that Acrobat get's always "null" as ID
    If we print the PDF with our PDFprinter, the header could be read by our Acrobat script. I don't know why this is... But now I changed the script to print the files via our PDF printer. Unfortunately I can't set a name for my exported file - do you know if there is a possibility to print PDF's without prompting after each one and with a via script given name?
    Here you can see the old script for InDesign and right after it, the Acrobat sript. Maybe I made some mistake by generating my PDFexport and don't need to use the printer?
    INDESIGN SCRIPT:
      * prompts filebrowser and stores name and path of file in variable
    var sourceDocument = File.openDialog("Bitte Indesign-Dokument auswählen", "*.indd", false);
      * stores only prefix of filename for use as new filename
    var newName = sourceDocument.name.substr(0,  sourceDocument.name.length-5);
      * stores folder where file is stored
    var dbSourceFolder = sourceDocument.parent+"/";
      * prompts for databasefile where generating should begin
    var dbstartfile = File.openDialog("Bitte Start-Datenbankdatei auswählen", "*.txt", false);
      * gets basename of databasefile
    var dbstartfilename = dbstartfile.name.slice(0, dbstartfile.name.search(/_Teil+/));
      * gets number of first databasefile
    var i = dbstartfile.name.slice(dbstartfile.name.search(/_Teil+/)+5).slice(0, -4);
      * generates path name and name of first databasefile to use
    var dbSource = dbstartfile;
       *set PDF preset for generating PDF
    var PDFPreset= app.pdfExportPresets.item("GAG-PDF");
       * stops throwing of alerts
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
    // if databasefile isn't existing message will be thrown
    if( dbSource.exists == false ) {
        // restart of alert throwing
        app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
        alert("Datei " + dbSourceFolder+dbprefix+"_Teil"+i+".txt konnte nicht gefunden werden! \n\rBitte starten Sie den Vorgang erneut und geben Sie die richtige Datenbankdatei an." );
    // else process starts
    else {
        while(  dbSource.exists == true ) {
            // opens source indesign document without showing it
            mergeDocument = app.open(File(sourceDocument), false);
            // sets which databasefile should be used for data merge
            mergeDocument.dataMergeProperties.selectDataSource(File(dbSource));
            // starts merging of indesign document and database file
            mergeDocument.dataMergeProperties.mergeRecords();
            // exports generated document as PDF file
            app.activeDocument.exportFile(ExportFormat.pdfType, File(sourceDocument.parent+"/"+newName+"_Teil"+i+".pdf"), false, PDFPreset);
            // closes opened indesign document
            mergeDocument.close(SaveOptions.no);
            i++;
            // change filename of database file to get next file
            dbSource = File(dbSource.parent+"/"+dbstartfilename+"_Teil"+i+".txt");
    // restart of alert throwing
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
    alert("PDF-Generierung abgeschlossen!");
    ACROBAT SCRIPT:
    * Path where files should be saved
    * Special Characters like spaces should be escaped with \
    * If you want to modify the folder, use following form:
    * "/Driveletter/Foldername/../LastFolderName/"
    * Make sure not to forget the / before and after the location
    var filepath = "/c/pdf_split_test/";
    * Number of expose pages - feel free to change
    var pageType = app.prompt("Bitte geben Sie die gewünschte Seitenzahl der Exposés an.", "");
    alert(pageType);
    * regular expression for search
    var idNumber = /08\d\d\d\d\-\d\d\d\-\d\d\d\d\d-\d\d\d-\d\d/g;
    * if possible this function extracts the searched number as string
    * @param rematch string which should be searched in document
    * @return null if rematch is not found or string if rematch is found
    function ExtractFromDocument(reMatch) {
      try {
             var Out = new Object();
             for (var i = 0; i < 1; i++)
              numWords = this.getPageNumWords(i);
              var PageText = "";
              for (var j = 0; j < 30;j++) {
                  var word = this.getPageNthWord(i,j,false);
                  PageText += word;
              var strMatches = PageText.match(reMatch);
              if (strMatches == null) continue;
          return strMatches;
      } catch(e)
          app.alert("Processing error: "+e)
    * tries to load given filename (extracted number)
    * @param filename string of file which should be checked
    * @param n number to iterate while checking for files
    * @return true if file exists or false if not
    function checkIfFileExists(filename, n) {
        var existingDoc = false;
        try {
            if( n == 0) {
                var checkDoc = app.openDoc(filepath+filename+"-000.pdf");
            } else {
                var checkDoc = app.openDoc(filepath+filename+"-000_"+n+".pdf");
            checkDoc.closeDoc();
            existingDoc = true;
        } catch (e) {
        if( existingDoc == true ) {
            n = n+1;
            n = checkIfFileExists(filename, n);
        return n;
    var pageAmount = this.numPages;
    for( i=0; i<pageAmount; i+pageType ) {
        var filename = ExtractFromDocument(idNumber);
        fileExistence = checkIfFileExists(filename, 0);
        if(fileExistence != 0) {
            this.extractPages({nEnd:(pageType-1), cPath : filepath+filename+"-000_"+fileExistence+".pdf"}); 
        } else {
            this.extractPages({nEnd:(pageType-1), cPath : filepath+filename+"-000.pdf"});
        this.deletePages({nStart:0, nEnd: pageType-1});

    Hi,
    I have a little problem with generating a PDF. First my Workflow:
    I have a InDesign document with 6 pages. This document is merged with a databasefile containing 100 records. After merging it, we have to generate a PDF file. This PDF file is opened within acrobat. Within the document, I'm searching for an ID each record has so I can split the document to 100 files (each with 6 pages) and name it by the ID I found.
    Why you don't export 6-page PDFs directly from InDesign?
    robin
    www.adobescripts.co.uk

  • How do I enable a Java plug-in via script that was just added to the blocklist?

    I need to enable Java 6u29 that was just added to the blocklist via script because there are several thousand end-nodes involved. Also, I am constrained to Firefox 3.6 due application compatibility issues.

    Probably the only or easiest way to remove or disable the blocklist of older Java versions would be to disable blocklisting by locking the extensions.blocklist.enabled to false via a mozilla.cfg file.<br />
    You are already running a no longer supported Firefox 3.6.x version that won't receive updates.
    You can use a mozilla.cfg file in the Firefox program folder to lock prefs or specify new (default) values.
    Place a file local-settings.js in the defaults\pref folder where you also find the file channel-prefs.js to specify using mozilla.cfg.
    pref("general.config.filename", "mozilla.cfg");
    pref("general.config.obscure_value", 0); // use this to disable the byte-shift
    See:
    *http://kb.mozillazine.org/Locking_preferences
    You can use these functions in mozilla.cfg:
    defaultPref(); // set new default value
    pref(); // set pref, but allow changes in current session
    lockPref(); // lock pref, disallow changes
    lockPref("extensions.blocklist.enabled", false);
    *http://kb.mozillazine.org/extensions.blocklist.enabled

  • How to set layer color property via script?

    I'm looking for a way to set a layer's UI color property via script (see attached). Any help would be greatly appreciated!

    jrapczak2 wrote:
    Uhm.. wow. That's crazy complicated
    It is even more complicated to work with multi-selected layers.
    if( app.documents.length > 0 && versionCheck()  ){
         app.activeDocument.suspendHistory("Set Layer's Color", 'changeLayersColor()');
    function versionCheck()  { return app.version.match(/1[1|2]./) >= 11; };
    function changeLayersColor(){
         function setActiveLayerColor( color ) {
              var desc = new ActionDescriptor();
                   var ref = new ActionReference();
                   ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
              desc.putReference( charIDToTypeID('null'), ref );
                   var colorEnumDesc = new ActionDescriptor();
                   colorEnumDesc.putEnumerated( charIDToTypeID('Clr '), charIDToTypeID('Clr '), color );
              desc.putObject( charIDToTypeID('T   '), charIDToTypeID('Lyr '), colorEnumDesc );
              executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
         function getSelectedLayersIdx(){
                   var selectedLayers = new Array;
                   var ref = new ActionReference();
                   ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
                   var desc = executeActionGet(ref);
                   if( desc.hasKey( stringIDToTypeID( 'targetLayers' ) ) ){
                        desc = desc.getList( stringIDToTypeID( 'targetLayers' ));
                         var c = desc.count
                         var selectedLayers = new Array();
                         for(var i=0;i<c;i++){
                             try{
                                  activeDocument.backgroundLayer;
                                  selectedLayers.push(  desc.getReference( i ).getIndex() );
                             }catch(e){
                                  selectedLayers.push(  desc.getReference( i ).getIndex()+1 );
                    }else{
                        var ref = new ActionReference();
                        ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "ItmI" ));
                        ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
                        try{
                             activeDocument.backgroundLayer;
                             selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" ))-1);
                        }catch(e){
                             selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" )));
                   return selectedLayers;
         function makeActiveByIndex( idx, visible ){
              if( idx.constructor != Array ) idx = [ idx ];
              for( var i = 0; i < idx.length; i++ ){
                   var desc = new ActionDescriptor();
                   var ref = new ActionReference();
                   ref.putIndex(charIDToTypeID( "Lyr " ), idx[i] );
                   desc.putReference( charIDToTypeID( "null" ), ref );
                   if( i > 0 ) {
                        var idselectionModifier = stringIDToTypeID( "selectionModifier" );
                        var idselectionModifierType = stringIDToTypeID( "selectionModifierType" );
                        var idaddToSelection = stringIDToTypeID( "addToSelection" );
                        desc.putEnumerated( idselectionModifier, idselectionModifierType, idaddToSelection );
                   desc.putBoolean( charIDToTypeID( "MkVs" ), visible );
                   executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
         var colors = ['None','Red','Orange','Yellow','Green','Blue','Violet','Grey'];
         var colorIDs = [charIDToTypeID('None'),
                                  charIDToTypeID( "Rd  " ),
                                  charIDToTypeID( "Orng" ),
                                  charIDToTypeID( "Ylw " ),
                                  charIDToTypeID( "Grn " ),
                                  charIDToTypeID( "Bl  " ),
                                  charIDToTypeID( "Vlt " ),
                                  charIDToTypeID( "Gry " )];
         var dlg = new Window( 'dialog', 'Change Layer Color' );
         dlg.ddColors= dlg.add("dropdownlist", undefined,  colors);
         dlg.ddColors.preferredSize.width = 100;
         dlg.ddColors.items[0].selected = true;
         dlg.ok = dlg.add('button',undefined,'Ok');
         dlg.cancel = dlg.add('button',undefined,'Cancel');
         var results = dlg.show();
         if( results == 1 ){
              var selectedLayers =  getSelectedLayersIdx();
              for( var l=0;l<selectedLayers.length;l++ ){
                   makeActiveByIndex( selectedLayers[l], false );
                   setActiveLayerColor( colorIDs[dlg.ddColors.selection.index] );
              makeActiveByIndex( selectedLayers,false );

  • How can I set Firefox update preferences via script so I can configure our 200 Macs to disable checking for updates?

    Most of our Mac users do not have admin privileges. So when they get alerted about Firefox updates, they don't have the ability to install them. We would like to disable Firefox for checking for updates, then push out updates from our software server as needed. We have about 200 machines to configure. Is there a way to disable checking for updates via script (bash or Applescript)? And if so, is there a guide or web site to explain the process?

    Use a mozilla.cfg file in the Firefox program folder to lock prefs or specify default values.
    Place a file local-settings.js in the defaults\pref folder where you also find the file channel-prefs.js to specify using mozilla.cfg.
    pref("general.config.filename", "mozilla.cfg");
    pref("general.config.obscure_value", 0); // use this to disable the byte-shift
    See:
    * http://kb.mozillazine.org/Locking_preferences
    You can use these functions in mozilla.cfg:
    defaultPref(); // set new default value
    pref(); // set pref, but allow changes in current session
    lockPref(); // lock pref, disallow changes

  • Writing commands to get specific data channels in the output report via script or automated script generation..

    In my project I have to make certain calculation and then get the data plotted in the given report template. I am using automated script for this. My script is doing all the calculations and then it not selecting and drag-dropping the selected channels on the report template. Its saving the blank report template.
    I am struggling to get the data for specific channels plotted by using the script. I need the selected channels to be plotted on this report template and then get it saved.
    Any help will be deeply appreciated. Thanks
    Solved!
    Go to Solution.

    Hi LaxG,
    Brad is absolute right. It is possible to create your whole layout via script.
    If you have loaded  the example report layout you can copy these lines to create a new line in your plot. This is the recommended object oriented way.
    call Report.Sheets("Blatt 1").Objects("2D-Axis1").Curves2D.Add(e2DShapeLine, "anyName")
    Report.Sheets("Blatt 1").Objects("2D-Axis1").Curves2D.Item("anyName").Shape.XChannel.Reference               = "[1]/Zeit"
    Report.Sheets("Blatt 1").Objects("2D-Axis1").Curves2D.Item("anyName").Shape.YChannel.Reference               = "[1]/Geschwindigkeit"
    For performance reasons it's recommended to use the it like this.
    dim oLine
    set oLine = Report.Sheets("Blatt 1").Objects("2D-Axis1").Curves2D.Item("anyName").Shape
    oLine.XChannel.Reference               = "[1]/Zeit"
    oLine.YChannel.Reference               = "[1]/Geschwindigkeit"
    Like Brad mentioned it is much easier, that you have a stored template of your report with all setings and customisations already done.
    You open this layout file and have stored the names of your calculated channels. When you are doing this with a script they always have the same name and belong to the same group.
    Now you can customize the references of the line items.
    Kind Regards,
    Philipp K.
    AE | NI Germany

  • ITunes Music Locations - controlling workstations remotely via script?

    I do storage administration at a company with over 2000 users scattered across the globe. Predictably, at least have use iTunes. We redirect the "My Documents" folder to a network location to force the backup of critical project data. This creates a huge problem for us. iTunes defaults to using the My Music folder in My Documents. This means we are storing and backing up at least 1TB of music.
    I have found that iTunes stores its configuration in xml files in the application data directory in the user profile. I cannot readily figure out where in this file the location is recorded.
    Has anyone confronted this problem, and if so, is there a way to control iTunes installs remotely to set the music folder location, via script, GPO or anything at all?

    The library location is indeed stored in the iTunesPrefs.xml file. Look for the key "iTunes Library Location:1".
    But I have a script that almost does what you want. Here is the perl source:
    http://home.comcast.net/~teridon73/itunesscripts/itunesopenlibrary.txt
    Here is a compiled EXE for it:
    http://home.comcast.net/~teridon73/itunesscripts/itunesopenlibrary.zip
    Anyway, the script basically works by setting the library location to a path that you pass to it. It does so by updating the iTunesPrefs.xml file. This file is very small, so you shouldn't need to worry about it!
    Of course, the script only works if the iTunesPrefs.xml file already exists. It would be nice if you could include a template iTunesPrefs.xml in your new user creation/login script. If the path is the same for every user, well, then you're done I guess.
    If not, you can run the script to set the path to what you really want it to be.
    Existing users are a different story. You can run my script to change the library location, of course. But then you also have to move their existing library file and their music back to that location. Well, you don't have to; you can make the users do it themselves! Also, I don't know if that will work as I haven't tested it.
    I haven't fully explained everything, but I don't have time right now. I hope at least I've given you some ideas. Of course the optimum solution is an Apple-provide GPO you could use. You can try asking apple for it via either a bugreport (if you have an ADC account), or the feedback page for iTunes:
    http://www.apple.com/feedback/itunesapp.html
    Rob

  • Getting text object content and position via script / extra?

    Hello everybody,
    we have several Freehand files on OS X (maps) where I need to
    get the text content and the coordinates of objects in a given
    layer. I could not find a possibility how to achieve this via
    Freehand's Applescript support. Am I missing something or is this
    impossible with the standard scripting support?
    I have found a website about an older Xtra (CARTO-INDEX) that
    seems to something along those lines but it was written in the
    Classic days of the Mac OS. Is there a possibility or maybe even
    some sample code showing how this can be done with an Xtra? Is it
    possible to call an Xtra function via AppleScript?
    Illustrator seems to be no alternative here because although
    it seems to provide better scripting support, I get conversion
    errors with my Freehand documents and the object parameters do not
    match.
    Thanks in advance for your advice.

    > we have several Freehand files on OS X (maps) where I
    need to get the text
    > content and the coordinates of objects in a given layer.
    I could not find a
    > possibility how to achieve this via Freehand's
    Applescript support. Am I
    > missing something or is this impossible with the
    standard scripting support?
    MaPublisher 5 for FreeHand might do what you wish to do.
    http://www.avenza.com/products.mapub50.html
    Boris Jerenec and Michael Slomski have written useful Xtras
    for FreeHand.
    You can find contact info for them here, under "Other
    Plug-ins/Xtras".
    http://www.freehandsource.com/_frames/_misc/plugins.html
    If you decide to work in Illustrator, a script called "Make
    Point Type"
    converts FH text to AI point type. There's also a script to
    "Make Area
    Type".
    http://kelsocartography.com/scripts/
    Judy Arndt

  • How to get name of the slicer via script

    Hi Gurus,
    I was wondering if we could get the name of the slicer added in IR Query section, via script ??
    That is, I have a bqy connecting to Essbase OLAP.
    Now I am adding a slicer in OLAP Section via script.
    For Ex : ActiveDocument.Sections["Query2"].Slicers.Add('Market.Gen3,Market' , 'Market.LA')
    Now,for some reason, I wanted to retrieve the name of the slicer I added and assign it to a variable. Is this possible ?? I couldn't see any option for this. Please help me out if any one has done this before ?
    Thank You,
    Aji

    Sethil,
    Use your date(let us say Date1) instead of sy-datum.
    CALL FUNCTION 'MONTH_NAMES_GET'
    EXPORTING
    LANGUAGE = SY-LANGU
    IMPORTING
    RETURN_CODE =
    TABLES
    MONTH_NAMES = itab_month
    EXCEPTIONS
    MONTH_NAMES_NOT_FOUND = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    READ TABLE itab_month
    WITH KEY MNR = date1+4(2).
    itab_month-LTX will contain the value you are looking for
    Good luck
    Raghava

  • ODI 11g - Work Repository Creation via Script

    Hi!
    Do you have any suggestions how to create work repositories via script?
    My idea is to create all database objects in the schema for the new work repository and insert the repository specific information into the tables
    - SNP_REM_REP (master repository)
    - SNP_CONNECT (master reppository)
    - SNP_LOC_REPW (work repository)
    Am i missing something?
    Thanks in advance & kind regards
    Michael

    Why do you want to do it this way ?
    I dont think your idea is going to work as there are 87 other tables (maybe not all of them) in Work Rep that need to be populated. And only the Work repository creation menu in the Topology would do it for you. There are relationship among those tables that need to be satisfied.
    What version are you on ? In 11g you can write Java code to do the things I mentioned above. Whatever you can click and do in 10g can be done using Java programming in 11g.

  • CSS11500 - check via script and sending e-mail

    Hi together,
    I want to check some parameters via script on the css.
    That works fine.
    Is there any possibillity to send an email with the result of this check script directly from the css ?
    How do I have to configure the smtp server and the mailaddress.
    thanks in advance

    there is no sendmail functionality on the CSS.
    SO, if you want to send emails, you will have to work at tcp level and create your onwn mail client.
    Gilles.

  • Load dataplugin via script

    Hi there,
    how can i load a dataplugin (*.uri) via script? Can I check the current plug-ins, if the plug-in is already loaded?
    Greetings,
    Martin
    Solved!
    Go to Solution.

    Hi Martin
    The following will let you know what the current revision of a data pluggin is.
    The second function will update the data plugin if it requires it.
    Enjoy!
    Paul
    '  Gets the version of a dataplugin
    function GetDatapluginVersion(strDatapluginName)
      Dim oMyDataPlugin
      Set oMyDataPlugin = Navigator.Settings.RegisteredDataPlugins(strDatapluginName)
      GetDatapluginVersion = oMyDataPlugin.Version
      'Call MsgBoxDisp(oMyDataPlugin.Version)
    end function
    sub CheckUpdateAOP5
    dim strAOP5CurrentVersion,strAOP5LatestVersion
    dim MyVar
    dim path2AOP5: Path2AOP5 = "Yours to fill in"
    strAOP5CurrentVersion =GetDatapluginVersion("AOP5")
    strAOP5LatestVersion = "11.0.1f5081"
    if strAOP5CurrentVersion = strAOP5LatestVersion then
    'msgbox("AOP5 Latest version:"&strAOP5LatestVersion & " equals " &strAOP5CurrentVersion )
    else
    MyVar = MsgBox("AOP5 Dataplugin requires updating Update Now?", vbYesNo + vbQuestion, "DIAdem")
    Select Case MyVar
    Case vbYes
    Call ExtProgram( Path2AOP5 )
    End Select
    end if
    end sub

  • OSX 10.9 Maverick add a LDAP server via script

    I use applescript to add a LDAP sever on 10.8, but after the 10.9 released, I found the script cannot use any more.
    Seems is the new Mail app doesn't support LDAP sever , it is integrated to Internet Accounts
    However the SAMPLE script is still the same. (  /Library/Scripts/Mail\ Scripts/Create\ New\ LDAP\ Server.scpt )
    Does any one know how to config internet accounts via script (BASH script is OK too)?
    the new mail app does not understand
    make new ldap server with properties {name:theName, host name:theAddress, search base:theSearchBase, Çclass ldpoÈ:thePort, scope:theScope}
    any more.

    I'd first read the subject and thought this involved creating an entire LDAP server via script and thought... whoa, that's some script.    
    But you're seeking to reference a remote resource or some automated way to configure your client mail, and that's currently using LDAP, right?  If so, then Apple has shifted over to Profiles and away from LDAP and MCX and related.  Profiles would be the approach I'd follow here, either with OS X Server and its profile manager or some other MDM service.
    If you have access to the Apple WWDC13 session videos, there's a session on the Profile Manager that might be worth your time.

  • Update and replace a index via script

    Hi everybody,
    I created a book with 30 chapters, each of them having a local (or chapter) index at the last pages.
    I would like to update these indexes and replace them with the new, updated ones (just as the command "Generate Index..."
    do with the option "Replace the Existing Index" on).
    I'm able to generate the index via script, but I don't know how to make it replace the existing one.
    I dont want the Place the Index, as its precise location is variable and it can run for more than one page and frame.
    So even I could get the coordinates of an existing index to place the new one,
    I would have the re-layout them, what would defeat my automation goal altogether.
    I just want to replace the existing indexes via script, as I can do using the interface.
    Is it possible?
    Thank you all in advance.
    Edson Furman
    [email protected]

    I'd like to re-ask the same question. I am able to generate an index for the first time, but am at a loss how to do the scripting equivalent of pressing the "OK" button in the following dialog:
    I'm guessing I should proceed something like this:
    myDocument.indexGenerationOptions.replaceExistingIndex = true;
    myIndex = myDocument.indexes[0].update();
    myIndex.generate( ? DO I REALLY HAVE TO SPECIFY A PAGE ETC. HERE ? );

  • Sort by Name via script

    Hi everybody,
    I would appreciate if someone could give some clue to sort by name the
    Paragraph Styles, Character Styles, Object Styles and Swatches panels
    via script.
    Thank you all in advance.
    Edson Furman
    [email protected]

    For sorting styles I have used the script listed below -- works in CS3 and CS4 though it's been a while since I last tried. It could be coded more elegantly but it always worked fine as it is. It doesn't take into account any style groups -- I don't know what happens if your documents contain any so you'd better not try.
    As to swatches, these are not so easy to sort. There was some discussion about this at either of these sites:
    http://www.hilfdirselbst.ch/gforum/gforum.cgi?jump=forum%3D4
    http://indesign-faq.de/
    Peter
    #target indesign
    sort_par_styles (app.documents[0]);
    sort_char_styles (app.documents[0]);
    sort_obj_styles (app.documents[0]);
    function sort_par_styles (doc)
        var string_array = sort_par_names (doc);
        for (var i = 0; i < string_array.length; i++)
            doc.paragraphStyles.item (string_array[i]).move (
                LocationOptions.after, doc.paragraphStyles[i+2])
    function sort_par_names (doc)
      var array = doc.paragraphStyles.everyItem().name;
      array.shift (); array.shift ();  // exclude [No p.] and [Basic p/]
      return array.sort (case_insensitive);
    function sort_char_styles (doc)
        var string_array = sort_char_names (doc);
        for (var i = 0; i < string_array.length; i++)
            doc.characterStyles.item (string_array[i]).move (
                LocationOptions.after, doc.characterStyles[i+1])
    function sort_char_names (doc)
      var array = doc.characterStyles.everyItem().name;
      array.shift ();  // exclude [None]
      return array.sort (case_insensitive);
    function sort_obj_styles (doc)
        var string_array = sort_obj_names (doc);
        for (var i = 0; i < string_array.length; i++)
            doc.objectStyles.item (string_array[i]).move (
                LocationOptions.after, doc.objectStyles[i+4])
    function sort_obj_names (doc)
      var array = doc.objectStyles.everyItem().name;
      array.shift (); array.shift (); array.shift ();  array.shift (); // exclude  [None], [Basic Graphics Frame], [Basic Text Frame], [Basic Grid]
      return array.sort (case_insensitive);
    function case_insensitive (a, b)
      return a.toLowerCase() > b.toLowerCase()

Maybe you are looking for