• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Using Fcodes in ExtendScript

Guest
Jun 24, 2011 Jun 24, 2011

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 25, 2011 Jun 25, 2011

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 25, 2011 Jun 25, 2011

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 25, 2011 Jun 25, 2011

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 25, 2011 Jun 25, 2011

Copy link to clipboard

Copied

Thanks Michael,

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 27, 2011 Jun 27, 2011

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 27, 2011 Jun 27, 2011

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 27, 2011 Jun 27, 2011

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 27, 2011 Jun 27, 2011

Copy link to clipboard

Copied


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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 27, 2011 Jun 27, 2011

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 25, 2011 Jun 25, 2011

Copy link to clipboard

Copied

Oliver,

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

Fcodes([FCodes.TXT_BOLD]);

Ian

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines