10 Replies Latest reply on Jun 27, 2011 4:29 PM by Ian Proudfoot

    Using Fcodes in ExtendScript

    OliverJohn

      After spending too much time combing through the OMV, looking (unsucessfully) for information online, and then just falling back to simple trial-and-error, I thought it was worth sharing a couple of things:

       

      • While the FCodes function does not appear anywhere in the OMV, it does exist in ExtendScript, and is called like a global function.
      • Unlike its FDK twin, it takes only one argument--the array of fcode values.

       

      So, in it's simplest form:

       

      codes = new Array();

      codes[0] = FCodes.TXT_BOLD;

      Fcodes(codes);

        • 1. Re: Using Fcodes in ExtendScript
          Michael Müller-Hillebrand Level 4

          Oliver,

           

          I join your disappointment regarding the current status of the OMV as much as the non-existing documentation.

           

          The Fcodes() function can be found in the OMV in the Command class (handling menu commands). It seems to me the OMV has no method to present stuff at multiple locations.

           

          - Michael

          • 2. Re: Using Fcodes in ExtendScript
            Ian Proudfoot Level 3

            The content for the OMV seems to be defined in an XML file, so this must be a simple omission. Having said that I can find the omv XML files for InDesign but not FrameMaker... I have sent a message to the scripting documentation team highlighting the problem.

             

            Ian

            • 3. Re: Using Fcodes in ExtendScript
              Ian Proudfoot Level 3

              Oliver,

               

              The simplest form for your example could be reduced further to:

               

              Fcodes([FCodes.TXT_BOLD]);

               

              Ian

              • 4. Re: Using Fcodes in ExtendScript
                Michael Müller-Hillebrand Level 4

                Having said that I can find the omv XML files for InDesign but not FrameMaker...

                 

                For me it is here:

                 

                C:/Program Files (x86)/Common Files/Adobe/Scripting Dictionaries CS5/FrameMaker/OMV.xml

                 

                Interestingly, all other OMV files are named lower-case omv.xml.

                 

                BTW, I had to reinstall the ExtendScript Toolkit 3.5.0 before being able to update to 3.5.1.

                 

                - Michael

                • 5. Re: Using Fcodes in ExtendScript
                  Ian Proudfoot Level 3

                  Thanks Michael,

                  Mine was there too. Windows 7 indexing isn't really working for me.

                  • 6. Re: Using Fcodes in ExtendScript
                    OliverJohn Level 2

                    The Fcodes() function can be found in the OMV in the Command class (handling menu commands).

                     

                    What I see in the OMV under the Command class are two read-only properties (one that returns the value for a single fcode and another that returns an array), not a function.

                     

                    Are you seeing something different?

                    • 7. Re: Using Fcodes in ExtendScript
                      Michael Müller-Hillebrand Level 4

                      >> The Fcodes() function can be found in the OMV in the Command class (handling menu commands).

                       

                      What I see in the OMV under the Command class is are two read-only properties (one that returns the value for a single fcode and another that returns an array), not a function.

                       

                      Are you seeing something different?

                       

                      No, we see the same. I was not looking close enough (or have to get used to the icons in the OMV).

                       

                      So there seems to be missing a group of "really global" functions like Fcode() or Console() and maybe others.

                       

                      Sorry,

                       

                      - Michael

                      • 8. Re: Using Fcodes in ExtendScript
                        Ian Proudfoot Level 3

                        Michael,

                        There is a Globals class and I believe that's where the missing methods should be listed. The following are methods that I can't find in the OMV (There are a few other methods I'm not sure about):

                        • AddCommand()
                        • Console()
                        • Fcodes()
                        • OpenAnyHow()
                        • SaveAs().

                         

                        Ian

                        • 9. Re: Using Fcodes in ExtendScript
                          OliverJohn Level 2


                          The following are methods that I can't find in the OMV (There are a few other methods I'm not sure about):

                          • AddCommand()
                          • Console()
                          • Dimension()
                          • Fcodes()
                          • OpenAnyHow()
                          • SaveAs().

                           

                          I think I have the mixed disadvantage/advantage of not coming from a FrameScript background. I'm guessing at least some of the missing commands you mentioned are particular to that platform, as they're not mentioned anywhere in the FDK Reference.

                           

                          For example, while there is no AddCommand(), the app class does have a NewNamedCommand() method, 'Save As' is achieved by setting the appropriate saveParam ProvVal (FS_SaveMode/FV_ModeSaveAs) before calling Save(), and OpenAnyHow() sounds to me like a handy set of openParam PropVals set to FV_DoOK. (Like I said, I don't know FrameScript, so please excuse any blatant ignorance that's showing)

                           

                          My hope is that it won't be long before we start to see .jsx libraries that replicate the functionality of some of FrameScript's robust features.

                          • 10. Re: Using Fcodes in ExtendScript
                            Ian Proudfoot Level 3

                            Nothing to do with FrameScript. All of these 'missing' methods were found in the ESTK data browser but only when FrameMaker is the target application. There are also some UI related methods that are not related to ScriptUI...

                             

                            Ian