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

Alert Function

New Here ,
Jul 17, 2018 Jul 17, 2018

Copy link to clipboard

Copied

Hi All,

Is the description of the alert function given in the Adobe FrameMaker Scripting Guide, release 2017-01-31, always up to date?
For any type value in the range from 0 to 5, only OK button is shown.

The example of alert function js code shown below use always and only OK button.
The syntax of alert function in this example uses three parameters : message, title and  type.
It is good to know that the message parameter allows to define a title for the alert box.
But is the third type parameter always read and used by alert function?

...

var alertname = "Update all Text-Insets in a FM Template";

// If the active document is  valid then ...

if (doc.ObjectValid() == true)

  {

      ti = doc.FirstTiInDoc; 

      while (ti.ObjectValid () == 1)

          { 

          ...

          }

    alert ("Script execution is completed!\nAll Text Insets have been updated.", alertname, Constants.FF_ALERT_CONTINUE_NOTE);

  }

else

  {

    alert ("No FM Template file is selected.", alertname, Constants.FF_ALERT_CANCEL_DEFAULT);

  }

...

Do you have any opinion or applicable and useful documentation on this subject?

JM

TOPICS
Scripting

Views

684

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 ,
Jul 17, 2018 Jul 17, 2018

Copy link to clipboard

Copied

Hi JM,

you better have a look at "Javascript Toolsguide" page 111.

alert()

confirm()

and prompt().

It's explained in detail.

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
New Here ,
Jul 17, 2018 Jul 17, 2018

Copy link to clipboard

Copied

Thanks Klaus,
Yes, older (2010) Adobe Javascript Toolsguide is more accurate than their latest Scripting Guide dedicated to FrameMaker.
JM

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
Mentor ,
Jul 17, 2018 Jul 17, 2018

Copy link to clipboard

Copied

LATEST

Hi JM,

I think you are confusing the native Javascript alert() with the FM Extendscript Alert()  (capital A). Only Alert() has the parameters that you mention. But there should be only two, so I think a sample call would be something like:

Alert ("Script execution is completed!\nAll Text Insets have been updated.", Constants.FF_ALERT_CONTINUE_NOTE);

...that is, I don't know why you put 'alertname' in there.

A little bit of background... this function is a carryover from the FDK function F_ApiAlert(). With the FDK, there are no native alert boxes so the kit included a few like this. With JavaScript, we now have some native language tools available that can replace the FDK versions. But in this case it is easy to get mixed up. It is this way, though, because by convention, the ES developers apparently just removed "F_Api" from all functions to adapt to ES, so this is consistent with the rest of the migration.

Russ

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