15 Replies Latest reply on Jun 19, 2010 5:29 PM by [Jongware]

    [CS5/JS] Ann: Javascript Help files updated

    [Jongware] Most Valuable Participant

      Hi everyone. The new user-friendly Javascript Help files have been updated with a CS5 version. Download link on its homepage: http://www.jongware.com/idjshelp.html

       

      Only in Windows CHM-format for the moment (does anyone at all use the HTML version? If not ... well ... I dunno...).

       

      I spotted a few additions and changes in the Help file -- apart from support for the new commands, obviously -- such as proper Superclass referencing, and a few objects with Class properties, which apparently are something else than Instance properties. Hey, don't ask me. I only converted the file.

       

      Among the more interesting new objects:

       

      * "PlaceGun" -- finally, a way to 'load' the gun with text created solely by scripting?

       

      * "BeforeCreate", "AfterCreate" (and a few more similar): trap the event for (possibly) every object you can place into ID!

       

      * A new Scripting Preference: measurementUnit. Apparently, this is "the measurement unit used during script processing" and, ya-hey!, we scripters don't have to awkwardly read, save, change, and restore, the measurement units anymore!

        • 1. Re: [CS5/JS] Ann: Javascript Help files updated
          Shonkyin Level 3

          Thank you very very much.

           

          It is a best Indesign scripting reference.

           

          Please provide HTML version if possible because i have Mac 10.4.11 in office and Robin Lu's iChm requires Mac OS X 10.5 or above.

           

          Shonky

          • 2. Re: [CS5/JS] Ann: Javascript Help files updated
            Harbs. Level 6

            Great work, Jong!

             

            FWIW, loading the placegun was always possible using doc.place(), but the new PlaceGun object does appear to give more control.

             

            Re. events: Yup! There's a whole pile of useful events which were added. Check out AFTER_SELECTION_ATTRIBUTE_CHANGED and AFTER_SELECTION_CHANGED...

             

            Thanks for the heads up re. the new scripting preference. I missed that one...

             

            Harbs

            • 3. Re: [CS5/JS] Ann: Javascript Help files updated
              Marijan Tompa [tomaxxi] Level 4

              Thank you Jong!

               

              Great work! I'm using it every day!

               

              tomaxxi

              • 4. Re: [CS5/JS] Ann: Javascript Help files updated
                [Jongware] Most Valuable Participant

                Sure, no problem. XSLT makes it really easy to generate different versions, so it's just a matter of actually doing it (the input for the CHM version is also HTML but there are a few tiny differences). I'll try to get it up a.s.a.p.

                • 5. Re: [CS5/JS] Ann: Javascript Help files updated
                  Shonkyin Level 3

                  Thanks Jong!

                   

                  Shonky

                  • 6. Re: [CS5/JS] Ann: Javascript Help files updated
                    [Jongware] Most Valuable Participant

                    The HTML version is now also available. 998 files, describing every single class and enumeration! (Plus some additional indexes and such -- totalling 1,028 files, 15,269,803 bytes (thereabouts).)

                     

                    It's marginally 'nicer' than the CHM version. For some reason Ole Kvern (I'm pretty sure it was him ) now describes various properties as 'value=any'. In previous versions of InDesign, this was just 'any', and I translated that into a full list of properties.

                    Now I have to check for the other string as well! I already caught a few of them in the first CHM version, now I think I got them all. If I spot any more tiny (or bigger) omissions, I'll create an updated set of both versions.

                    • 7. Re: [CS5/JS] Ann: Javascript Help files updated
                      Shonkyin Level 3

                      Great work Jong!

                       

                      Thanks again for HTML Version.

                       

                      Shonky

                      • 8. Re: [CS5/JS] Ann: Javascript Help files updated
                        brettpolo Level 1

                        Thanks Jong!

                         

                        This is easly the most important refrence for InDesign scripting.

                        • 9. Re: [CS5/JS] Ann: Javascript Help files updated
                          [Jongware] Most Valuable Participant

                          An updated CHM version is available: http://www.jongware.com/binaries/idcs5js_chm_3.0.1b.zip

                           

                          Some minor revisions:

                           

                          * Steven ... asked for a Favourites tab. No problem!

                           

                          * Some of the longer descriptions were ignored when there was also a short description (see UnitValue, for example).

                           

                          * Added a few more internal cross-references. (Its internal reference system is slightly different from my 'flattened' pages, so I have to convert them. The SUI elements are still a pain, as they have the same names as a few of ID's elements -- they throw off everything )

                           

                          * For some reason the page for the "Global classes" was interpreted in the CHM contents as a 'book', rather than a regular help page, and you could not navigate to there! (A search for 'inifinity' still landed you on that page.) Fixed by hand, but I wonder why this happened ...

                           


                           

                          Edit: Minor update:

                          With some more CHM trickery I added a Home button (goes to the Contents page) and an Index button (goes to the Class Index). Updated version number to 3.0.1b.

                          • 11. Re: [CS5/JS] Ann: Javascript Help files updated
                            [Jongware] Most Valuable Participant

                            This might come in handy for the CS5 HTML file users: a full index of all classes and enumerations and their properties and methods. It all adds up to a single massive 2.5 MB file, so you might want to open it only once and then open the link you need in a new window/tab -- even my fast Mac has to think a while before I see it pop up in its entirety. No wonder: it contains a total of 24,925 links. You'll hopefully forgive me for not checking each and every single one of these.

                             

                            Direct download link for the 195 KB zipped file: from my site. Put it in the folder with the rest of the CS5 HTML files, so the links will work properly.

                             


                             

                            This started out as yet another exercise in XSLT: gathering info from three different levels (the classes and enumerations are one, properties another, and methods a third), sorting all of them in a single case insensitive list, and listing multiple items as "sub-level" in the index. FYI, that needs a lines looking like this:

                             

                            <xsl:if test="generate-id(/dictionary/package/classdef[elements/method[@name=$this]][1]/elements/method[@name=$this]) = generate-id()">

                             

                            and I won't hold it against you if you say, "Whuh?"

                            (Things were made more complicated because property names may be duplicated inside the same class: 'baseUnit', in 'UnitValue', appears twice; and I don't even know the difference between the two! I had to add a dirty-ish hack before I could use 'generate-id' on those.)

                             

                            Even though it would have made life much simpler, I did not cheat by copying everything I needed into an intermediary file first! The single one input file for the transformation was the original CS5 OMV XML file (with minor typos corrected -- there seem to be a few, if you look closely ...).

                             

                            Generated using the great Saxon 8 wrapper Kernow, a must-download if you want to have a go at XSLT. You'll need that, and a lot of patient googling ...

                            • 12. Re: [CS5/JS] Ann: Javascript Help files updated
                              [Jongware] Most Valuable Participant

                              Minor cosmetic updates to the CHM version:

                               

                              * The bullet was shown as a decoded UTF-8 value on Robin Lu's Mac CHM viewer. Changed from its Unicode value to "&bull;" (quite the trick, as Saxon firmly objects to HTML stuff like that!). There may be more 'mangled' characters remaining, dunno if it's worth the trouble hunting them down one by one tho'.

                               

                              * Contrary to what I stated before, the Help does contain a few examples -- in the JavaScript Base Classes section. Rather terse, so for the experienced scripter they are hardly relevant; but perhaps newbies can put them to good use. They are marked by a pretty-in-pink background.

                               

                              * The list of parents in the Hierarchy view was not sorted alphabetically -- fixed. (I've finally started using XSLT 2.0 functions. Yay!)

                               

                              * Lists of multiple object datatypes were not sorted alphabetically -- fixed, by sorting them on the comma and the word "or". However, some of the more incomprehensible descriptions now got just a bit more incomprehensible ...

                              E.g., common in "resize" functions: "Can accept: Array of 2 Reals, AnchorPoint enumerator or Array of Arrays of 2 Reals, CoordinateSpaces enumerators, AnchorPoint enumerators, BoundingBoxLimits enumerators or Long Integers." I have no idea how to mentally parse that, let alone have my computer do it.

                               

                              * Added more and more hyperlinks. I think most of ScriptUI's internal links to "Button", "Window", etc. which also have a 'regular' UI counterpart finally point to ScriptUI's own objects. Hard to check, really.

                               

                              * Also added hyperlinks for the common objects "Boolean", "String", "Number", and "Array" -- just to be complete!

                               

                              * The total number of internal hyperlinks now tops out above 104,000! (And no, I didn't check all of them.)

                               

                              Direct link to the CHM version: http://www.jongware.com/binaries/idcs5js_chm_3.0.3.zip

                              (the minor version number jump from .1 to .3 is because of a lot of testing before I got everything right -- again...)

                               

                              The HTML version follows, somehow, somewhere, some time later. (HTML users: is that full function index of any use?)

                               


                              * For some reason the page for the "Global classes" was interpreted in the CHM contents as a 'book', rather than a regular help page, and you could not navigate to there! (A search for 'inifinity' still landed you on that page.) Fixed by hand, but I wonder why this happened ...

                               

                              Oh darn it! I found out why that happened, re-wrote part of my XSLT transform to fix it and broke lots of other things. Today, I fixed that, and now I see this doesn't work anymore -- again!

                              You will be expecting a 0.4 version shortly, then.

                              • 13. Re: [CS5/JS] Ann: Javascript Help files updated
                                Marc Autret Level 4

                                Great and bountiful work! Thank you so much.

                                 

                                @+

                                Marc

                                • 14. Re: [CS5/JS] Ann: Javascript Help files updated
                                  [Jongware] Most Valuable Participant

                                  With compliments back from Jongware: a slightly better CHM version, now available at my site: http://www.jongware.com/idjshelp.html

                                   

                                  (Direct download link: http://www.jongware.com/binaries/idcs5js_chm_3.0.3b.zip)

                                   

                                  * Irritating "Global Elements" (name of the bookmark) <-> "global" (name of the class) now finally, once & forever, solved (hopefully)

                                  * A few more hyperlinks :-)

                                  * Index is divided into subtopics, for yet even easier searching.

                                  • 15. Re: [CS5/JS] Ann: Javascript Help files updated
                                    [Jongware] Most Valuable Participant

                                    A few more tiny interface improvements that kept on nagging me. CHM versions only, but both for CS4 and CS5, so if you are still using CS4, do download the update, it's significantly better than the old version.

                                     

                                    * Cleaned up the WinHelp supplied index -- everything is now nicely divided into subtopics.

                                    * Robin Lu's iCHM viewer for the Mac does not sort and concatenate index entries ... so I did it for him The index behavior is a little erratic: if you click an item, it goes through the list again and selects the first occurrence ... Ask Robin Lu to fix? (Don't know if it's still "in development" ...)

                                     

                                    Both CS4 and CS5 version numbers have been upgraded to 3.0.3e:*

                                     

                                    http://www.jongware.com/binaries/idcs4js_chm_3.0.3e.zip

                                    http://www.jongware.com/binaries/idcs5js_chm_3.0.3e.zip

                                     

                                    * [Ed.] Updated to 3.0.3e -- forgot to remove debug information (*sigh*)