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()

Similar Messages

  • How to get DP name via script

    Hello,
    We are migrating from Symantec Altiris to SCCM 2012. In our current environment we have both HP models and now moving towards Lenovo models. We are using both respective Enterprise solutions for managing driver that is HP SSM and Lenovo Thininstaller.
    We have 3 sites/locations with exactly the same shares on each one. We are using a script with a built in Altiris token that finds out what DP or Taskserver (in Altiris Environment) the client is connected to.
    How can I define a DP with the same type of script in SCCM?
    Are there any tokens for DP?
    Are there any specific local files or usuble values that changes when connecting to other DPs?
    Can I somehow query bounderies in a script and then use IF statement to connect them to a specific share?
    I know that I can use one share if I want to but that will use a lot of network trafic since we have the DPs on different locations throughout the country. One idea I had was to make 3 different packages with one DP specified in each
    one and then connect them to its specific boundary.  
    The good part to make it work all in one script is that it can be applied to any client in the organisation to update their current drivers and not just to use in initial deployment.
    I found a vbs script that can echo a DP, but how do I implement it into my script?
    http://sccmguru.wordpress.com/2014/04/22/show-dp-in-use-during-task-sequence/
    '// Purpose: Used to find active Distribution Point
    '// Version: 1.0 - April 15, 2014 - Odd-Magne Kristoffersen
    '// This script is provided "AS IS" with no warranties
    Set env = CreateObject("Microsoft.SMS.TSEnvironment")
    ENV_SMSTSHTTPTHI0000D = env("_SMSTSHTTPTHI0000D")
    SMSTSHTTPTHI0000D = Split(ENV_SMSTSHTTPTHI0000D,"/",-1,1)
    DP = split(SMSTSHTTPTHI0000D(2),".",-1,1)
    Echo DP(0)  
    Here is my script in short format. I didn't bother putting all the models.
    The value %MODEL% is from the Query in the beginning of the script and the %TASKSERVER% value is an Altiris token the can be used when running a script with the agent credentials.
    @echo off
    set model=
    FOR /F "tokens=2 delims='='" %%A in ('wmic ComputerSystem Get Model /value') do SET model=%%A
    Echo This is a %MODEL%
    IF "%MODEL%" == "HP EliteBook 820 G1" GOTO HP Updates
    IF "%MODEL%" == "HP EliteBook 840 G1" GOTO HP Updates
    IF "%MODEL%" == "HP Compaq 8000 Elite SFF PC" GOTO HP Updates
    IF "%MODEL%" == "HP Compaq 8100 Elite SFF PC" GOTO HP Updates
    IF "%MODEL%" == "HP Compaq 8200 Elite SFF PC" GOTO HP Updates
    IF "%MODEL%" == "HP Compaq Elite 8300 SFF" GOTO HP Updates
    IF "%MODEL%" == "20AQ007UMS" GOTO Lenovo Updates
    IF "%MODEL%" == "20AL00BYMS" GOTO Lenovo Updates
    IF "%MODEL%" == "10AB000YMX" GOTO Lenovo Updates
    IF "%MODEL%" == "20C0003TMS" GOTO Lenovo Updates
    IF "%MODEL%" == "20AL007NMS" GOTO Lenovo Updates
    IF "%MODEL%" == "10AAS0HN00" GOTO Lenovo Updates
    exit 1
    :Hp Updates
    \\%TASKSERVER%\Share\ssm.exe \\%TASKSERVER%\Share /ACCEPT /INSTALL /DEBUG /TITLE:"HP Updates" /NOREBOOT
    RMDIR "c:\ssm" /s /q
    exit 0
    :Lenovo Updates
    xcopy \\%TASKSERVER%\Share\Thininstaller c:\Thininstaller /S /H /I /Y
    c:\Thininstaller\Thininstaller.exe /CM -search A -action INSTALL -repository \\%TASKSERVER%\Share\Repository-noicon -includerebootpackages 0,3 -showprogress -noreboot
    RMDIR "c:\Thininstaller" /s /q
    exit 0

    The way these two driver management systems work is that the exe is not installed, only executed with different switches to look inside a share with drivers to match what is installed on the client and apply the missing drivers.
    I have checked other threads with HP ssm and Lenovo Thininstaller regarding SCCM implementation and they all create a package for the exe and apply the command switches. Exactly as many of you already described here.
    That works if you have only ONE share. I manage 3 shares, one for each geographical location that we prep Windows installations. This to make it faster for the client to download the drivers and to not use/load the WAN unnecessarily.
    I read on another thread that I can't query a dp because it's assigned only when the client requires content. 
    The only workaround as I see it is to:
    1. Create 3 different packages with different  shares in the command line. And somehow apply a detection method in the task sequence to figure out location (DP, IP, DNS, boundary, Assigned Domain Controller).
    2. Create 3 different packages and 3 different roles in MDT, one for every location. 
    3. Only use one share on the location that mostly is used for Windows installations and accept that it will take longer for the drivers to be applied on the other locations. 
    Which one should I go for?
    Many of you may think that I should use the standard way of managing drivers in SCCM. But this is so much easier. I never have to package drivers or hardware applications like HP Connection Manager. I can reapply the package to any client in production and
    update the drivers and model specific applications if needed.

  • 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

  • ITunes 11: In the store, I can no longer sort by name/artist/album

    I can no longer sort by name or artist or album when I'm in the store with iTunes 11.  Yes, I discovered the View Options in the Menu Bar. By when I select it nothing opens. Same for Command-J. It doesn't do anything either. I've tried hitting Command-J repeatedly, but nothing.
    The fact is, it seems utterly stupid to have this work differently than when you're in your library---by simply hitting name/artist or album in the bar at the top of the list. Having to sort lists in the Store via a completely different method than the lists in one's library is totally counter-intuitive.
    But back to my problem:  The View Options won't open for me. Anybody know how to fix this?
    I've got a lot of music I wish to buy, but I need different methods of sorting, otherwise it'll be a nightmare trying to keep track of things.
    Thanks,
    Doug

    I have the same exact problem.  I am using a Windows computer running Windows 7.  I was able to see them prior to the installation of 10.4.  I have this problem on 2 computers and have a hard time believing that no one else is having this problem

  • 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

  • How to find a text in the Frame maker document via script?

    How to find a particular text in the Frame maker document via script?

    johnsyns wrote:
    Why it doesn't work for the other days? When i tried to change the days other than wednesday. it return nothing.
    Reason why Justin's code does not work for other days is date format mask DAY returns day blank padded to 9 characters which is the longest day name which, yes you guessed right, is WEDNESDAY. You either need to blank pad or use format modifier FM:
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'DAY') = 'TUESDAY'
      5  /
    no rows selected
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'DAY') = 'TUESDAY  '
      5  /
    DT
    07-APR-09
    14-APR-09
    21-APR-09
    28-APR-09
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'FMDAY') = 'TUESDAY'
      5  /
    DT
    07-APR-09
    14-APR-09
    21-APR-09
    28-APR-09
    SQL> SY.

  • Is it possible to modify the tag structure tree and the role map via scripting?

    We use unstructured FrameMaker to produce training materials which we distribute as tagged PDF to meet accessibility requirements.
    When FrameMaker creates a tagged PDF, it does a fairly good job of populating the structure based on the PDF setup information for the paragraph formats in the FrameMaker documents. However, there are some limitations in the support that FrameMaker provides. For example, almost all paragraphs are assigned to the P role even if they are headings and should be mapped to H1-H6.
    We want to be able to easily post-process a PDF that has been generated from FrameMaker to fix some of the tag structure issues (including tag names and the role map) so that the PDF will provide the optimum experience for a user of the JAWS screen reader.
    I spent some time reading the SDK documentation but didn't find much information about manipulating a tagged PDF via the API, especially via scripting.
    Does anyone have any examples or references which explain how to do it?

    AFAIK, it's not possible with a script. You might want to ask in the SDK forum, as it could be possible with a plugin.

  • How to determine installed version of EMET via script?

    Hi all,
    I was not able to find a easy way to determine installed verison of EMET via script. If you can guide me in the right direction, this would help a lot.
    Many thanks
    Sam

    This is probably not the right forum for scripting questions and you didn't specify which script you (want to) use... Below you can find some examples...
    If you use VBscript you could use WMI and query the class Win32_Product:
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")
    Set colSoftware = objWMIService.ExecQuery _
    ("Select * from Win32_Product where Name like '%EMET%'")
    For Each objSoftware in colSoftware
    Wscript.Echo "Name: " & objSoftware.Name
    Wscript.Echo "Version: " & objSoftware.Version
    Next
    This method is not advisable because the class isn't optimized for queries and therefore the query takes a long time!
    You can also use the Windows Installer object:
    Option Explicit
    ' Connect to Windows Installer object
    Dim installer
    Set installer = Wscript.CreateObject("WindowsInstaller.Installer")
    Dim product, products
    Set products = installer.Products
    For Each product In products
    if instr(1,installer.ProductInfo(product, "InstalledProductName"), "EMET", vbTextCompare) > 0 AND instr(1,installer.ProductInfo(product, "Publisher"), "Microsoft", vbTextCompare) > 0 then
    Wscript.Echo installer.ProductInfo(product, "InstalledProductName")
    Wscript.Echo installer.ProductInfo(product, "VersionString")
    End If
    Next
    Set products = Nothing
    Set installer = Nothing
    Wscript.Quit 0
    This method enumerates all the products but be aware that you should also check the installstate because the installstate of a product also can be advertised.
    You can also use powershell to enumerate the uninstall registry keys but you have take into account that the results may be different on a 64-bit Windows and the bitness of the powershell proces:
    gci "hklm:\software\microsoft\windows\currentversion\uninstall" | foreach { gp $_.PSPath } | select DisplayVersion,DisplayName | where { $_.DisplayName -match "^EMET*" }
    You can also install and use the
    Windows Installer PowerShell Module and use this command:
    get-msiproductinfo | where { $_.Name -like '*EMET*' } | select ProductName,ProductVersion  | format-list
    On the internet you can find a lot of information about your question. For instance I found these pages:
    http://blogs.technet.com/b/heyscriptingguy/archive/2013/11/15/use-powershell-to-find-installed-software.aspx
    http://blogs.technet.com/b/alexshev/archive/2008/06/30/from-msi-to-wix-part-17-windows-installer-automation-interface-part-2.aspx
    W. Spu

  • 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

  • Exporting correct Hex colors via scripting

    Hello all,
    I need to export the fillColor of a paragraph style via scripting.
    I can get the fillColor property of the paragraph style, and can also convert CMYK to Hex. However, I do realize that the color values shown in InDesign are in whatever Color Space the document is using.
    My question is, is there a native API to convert the color values to a web safe color value? If not, how do I go about mapping the colors?
    Additionally, I see that Adobe internally knows how to convert it to a proper hex color (screenshot attached - note the color property in the Export Tagging pane). If I cannot use some native API, is there a way to access the text in that pane?
    Thanks all, in advance!

    @DerKäse (btw. funny name) – there is an add() method for colors that will take a Object Color as argument.
    Use that for your purpose.
    Here an example for RGB:
    var myDoc = app.documents[0];
    var myColorName = "myNewRGBColor";
    if(!myDoc.swatches.itemByName(myColorName).isValid){
        var myNewColor = myDoc.colors.add(
                name:myColorName,
                colorValue:[255,255,0], //A bright yellow
                model:ColorModel.PROCESS,
                space:ColorSpace.RGB
    Here one for CMYK:
    var myDoc = app.documents[0];
    var myColorName = "myNewCMYKColor";
    if(!myDoc.swatches.itemByName(myColorName).isValid){
        var myNewColor = myDoc.colors.add(
                name:myColorName,
                colorValue:[0,0,100,0], //A bright yellow
                model:ColorModel.PROCESS,
                space:ColorSpace.CMYK
    Hope, that helps…
    Uwe

  • Help: apply different para styles to several consecutive paragraphs via script

    Hi all,
    I need to apply different para styles to several consecutive paragraphs via script, something like this (found somewhere on the net):
    var myDoc = app.documents[0];
    var mySel = app.selection[0];
    var myPStyle1 = "A";
    var myPStyle2 = "B";
    //need to add 6 more styles here:
    //var myPStyle3 = "C";
    //var myPStyle4 = "D";
    //var myPStyle5 = "E";
    //var myPStyle6 = "F";
    //var myPStyle7 = "G";
    //var myPStyle8 = "H";
    //the last style not needed in script?
    // apply 1st style to 1st paragraph
    mySel.appliedParagraphStyle = myDoc.paragraphStyles.item (myPStyle1);
    // apply styles to paragraphs after selected
    //2nd style
    mySel.paragraphs[-1].insertionPoints[-1].appliedParagraphStyle = myDoc.paragraphStyles.item (myPStyle2);
    //next style
    mySel.paragraphs[-1].insertionPoints[-1].paragraphs[0].insertionPoints[-1].appliedParagrap hStyle = myDoc.paragraphStyles.item (myPStyle2).nextStyle;
    I've tried badly, but can't find the way to extend the sequence
    Sorry, no skills in scripting yet...
    all styles have 'Next Style' option activated, but I can't use 'Apply style, then Next style' or Object styles, because I need four different sequences of those para styles:
    A-B-C-D-E-F-G-H
    A-B-D-E-G-H
    A-C-D-F-G-H
    A-D-G-H
    and I really don't want to create special clones of the same style for each sequence (Keep It Simple, they say ).
    I believe it can be done via four slightly adjusted scripts...
    any suggestions would be greatly appreciated...

    Sorry about being late to the party, I usually pick up stuff like this right away.
    How about this one?
    1. No separate scripts needed, it uses a tiny dialog where you can choose what style set to use. If I'm correct, you can press a number key on Windows to immediately select one of the items.
    2. It works down from the paragraph your cursor is in. It has nothing to do with text frames, though -- consecutive paragraphs inside a story always ignore any text frames.
    3. Extensible: you can easily change the names of the styles in the top array, and the number of style groups in the list.
    var styleLists = [
              [ "A", "B", "C", "D", "E", "F", "G", "H" ],
              [ "A", "B", "D", "E", "G", "H" ],
              [ "A", "C", "D", "F", "G", "H" ],
              [ "A", "D", "G", "H" ]
    var radiobutts = [];
    styleDialog = app.dialogs.add ({name:"Set Multiple Styles",canCancel:true});
    with (styleDialog)
              with (dialogColumns.add())
                        with (radiobuttonGroups.add())
                                  for (i=0; i<styleLists.length; i++)
                                            // Build radio button string
                                            str = "&"+String (i+1)+". ";
                                            for (j=0; j<styleLists[i].length; j++)
                                                      if (j) str += "-";
                                                      str += styleLists[i][j];
                                            radiobutts.push (radiobuttonControls.add({staticLabel:str, checkedState:false}) );
    radiobutts[0].checkedState = true;
    if (styleDialog.show())
              for (i=0; i<radiobutts.length; i++)
                        if (radiobutts[i].checkedState == true)
                                  break;
              if (i < radiobutts.length)
                        par = app.selection[0].paragraphs[0];
                        for (j=0; j<styleLists[i].length; j++)
                                  par.appliedParagraphStyle = styleLists[i][j];
                                  par = par.parentStory.paragraphs.nextItem(par);

  • 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.

  • In Bookmarks, when I right click on a bookmark "SORT BY NAME" is no longer there. how do I get it back?

    In Bookmarks I used to be able to right click on a bookmark and in a menu box I could click on, SORT BY NAME, sort by name is no longer in the right click menu. I don't want to have to drag to sort bookmarks as I have too many. How do I get "SORT BY NAME" back in the right click menu in Bookmarks? Thanks, HT

    In Firefox the option to sort bookmarks is only available for folders and not for individual bookmarks.
    Easiest to sort by name is to do that in the left pane of the Bookmarks Manager (Bookmarks > Show All Bookmarks) and right-click the folder that you want to sort.
    *https://support.mozilla.org/kb/Sorting+bookmarks

  • Album 'sort by name'

    I just purchased Elements 10 and am disappointed that it is not possible to 'sort by name' in the Album.  This is a basic fundamental option in all OS so why not in Elements 10?
    John

      Albums will usually respect file names (alphabetical order) if you change from date sort.
    You can also drag to arrange and the photos will retain their fixed (numbered) positions.
    Click to view

  • Outlook sort by name - quicktype / searching by name using keyboard doesn't work right

    I'm not sure how to best explain this. In Outlook first you sort by name, and then you quickly type the first few letters of the person's name. 
    In Outlook 2010, this would cause it to go to the right person. For example if I type M-A-R it would go to Mark
    However in Outlook 2013 when I type M-A-R rapidly, it goes to the R's in the alphabet. 
    Anyone else had this experience and have a suggestion on how to do anything about it? 

    Hi,
    Could you give us more exact information? Did you refer to sort by "TO" or "From"?
    In Outlook 2013, on “Mai” tab, under "search box" section, there is no "By Name" option in the sort options.
    Please check and rebuild the index:
    Click start and in the search box type "Index". Go into the Indexing Options applet and Click "Modify". When the Indexed Locations dialog comes up, make sure " Microsoft Outlook" is checked.
    If the issue still persists, you can rebuild the index for test.
    Best regards,
    Karen Hu

Maybe you are looking for

  • Safari version? for 10.6.8

    I deleted Safari and now can't find a version that would install on my MacMini running 10.6.8. Where (website) should I go? Which version of Safari is appropriate? Any caveats?

  • Web page composer -end user

    hello, i've created a site with the help of this blog: "Web Page Composer - a new Way to create and publish Web Pages in the Portal" Web Page Composer - Web Page Layout (Part IV) Web Page Composer - the XML Editor Framework (Part II) Web Page Compose

  • ICH_HTTP_Connection Failed

    Hi Experts,                  I configured the RFC distination to connect legecy systems through HTTP connection to externel server. When i check the connection test is omiting error ICH_HTTP_Connection Failed. I have checked the SMICM and SICF is con

  • Master Detail - Detail parent child relationship

    Hello All, I have a setup where I have 3 tables. Call them A, B, and C. Table A is the parent table to the child table B. Also table B is the parent table to the Child table C. Is there a way to represent this in Apex? So far I have created two Maste

  • CFsearch as datasource

    Is there a way to turn CFsearch results into a dynamic datasource that can be easily used with Spry datasets? I would like to return a CFsearch result into a Spry table, but am having a mental block on the possible solution. I've thought of creating