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

FrameMaker SpellingChecker Automation

Community Beginner ,
Jan 13, 2022 Jan 13, 2022

Hi,

 

is there a way to automate FrameMaker SpellingChecker, so that means to write script which willl configure SpellChecker and get the log file with misspelled words ?

 

Any idea - FrameScript, ExtendScript or FDK ?

 

thanks.

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

correct answers 1 Correct answer

Community Expert , Jan 13, 2022 Jan 13, 2022

As far as I know, the FrameMaker Spell Checker is not exposed to the FDK or any of the scripting environments.

Translate
Community Expert ,
Jan 13, 2022 Jan 13, 2022

As far as I know, the FrameMaker Spell Checker is not exposed to the FDK or any of the scripting environments.

Translate
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
Community Expert ,
Jan 13, 2022 Jan 13, 2022

One thing that occurs to me: you can set FrameMaker to Auto Spellcheck and it adds a squiggly line under words not in its dictionary. I wonder if there is a property that is available that indicates the squiggly line that could be queried.

 

Anyone from Adobe that can tell us?

Translate
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 ,
May 07, 2025 May 07, 2025

@frameexpert - Sorry to revive an old, thread, but I had a similar question.

You can open the spelling checker pod with 

Fcodes ([FCodes.KBD_SPELLING]);

But I didn't find any mention of a way to automate clicking "Start Checking".

 

I'm okay with that, but I'm looking for a way to pause my script.

 

More info: I have a script that opens a pop-up window with buttons that runs operations on the document prior to creating a PDF.

 

For one of these operations, I would like the script to open the spelling checker (as above), and then post an alert, something like:

alert('The spelling checker pod is open./r/rPlease perform a spell check by clicking "Start Checking"/r/rPlease click OK to continue when completed.');

The problem I am running into is if I use a standard alert - or even a pseudo alert using a dialog window, the script stops, but the alert window has focus, so you can't click "Start Checking" until you close the alert by clicking OK. If I make a pop-up that looks like an alert but uses a palette window instead of a dialog, then I could click "Start Checking", but the script doesn't pause while the palette is displayed, so the script eventually brings up the print dialog and then I can't run the script until I clear that dialog.  I don't want to use a "return;" b/c then I'm basically in a loop with process document to spell check open, click Ok, manually run spell check, process document again, hit the same menu prompt. I don't want to use $sleep(xxx); b/c I'm not sure that would work, and I'm not sure how long it would take to spell check the document.

 

Can you think of any way to pause the script and still allow interaction with FrameMaker?

 

The only thing I can come up with is I created a custom confirm dialog: https://community.adobe.com/t5/indesign-discussions/autoclose-alert-message-and-custom-confirm-messa...

 

This should work, but it's fairly awkward:

        switch(CustomConfirm("The Spelling Checker Pod should be open. Please click OK and then click Start Checking to check the document. After the check is complete, click 'Make PDF' again./r/rIf you have previously run the spell check, click Continue.", "Spell Check:", 1, "OK", "Continue")){
            case "Continue":
                // Do nothing
                break;
             case "OK":
                return;
        }

Thanks in advance!

 

Translate
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
Community Expert ,
May 07, 2025 May 07, 2025

image.png

Translate
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 ,
May 07, 2025 May 07, 2025

@frameexpert - ??? Not sure what you are trying to tell me. I haven't heard of F_ApiFcodes(), and the posted snip doesn't tell me what they are. I could, in theory, use something like SendKeys or AutoHotKey to click the Start Checking button, but I still need to pause the script and/or get focus to the document so the user can make corrections.

 

CustomConfirm and return does work, so I may have to go with that.

Translate
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 ,
May 07, 2025 May 07, 2025

I'm thinking the best solution is to move Spell Check out of the PDF "flow" portion of the script and add an additional "Spell Check" button that opens the pod and prompts to do a spell check.

 

But I'm open to better suggestions as well!

Translate
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
Community Expert ,
May 07, 2025 May 07, 2025

F_ApiFcodes() is the Frame Developers Kit version of ExtendScript's Fcodes. I was trying to show you that Fcodes don't work to control Windows dialog boxes.

Translate
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 ,
May 08, 2025 May 08, 2025

@frameexpert - Okay, I copy now, but I really wasn't looking to simulate pressing the dialog box. What I was wanting was a way to pause the script until the dialog box OK button was pressed.

I'm still liking adding a separate button on the main window, but my idea might be possible with some sort of "flag variable". i.e. (air code):

Main window code: 

btnMakePDF.OnClick = function{
// other code
var OktoResume = false;

Fcodes ([FCodes.KBD_SPELLING]);

alertPalette("Spelling pod should be open",90);

 

while (OktoResume ===false) {
    if (OkToResume===true) {            
        break;
    } 
}

// Resume running code ...

}

alert Palette Code:

 

function alertPalette(message, title, bgcolor){
   title = title || "Script Alert";
   bgcolor = bgcolor || "gray";
        var win = new Window("palette", title, undefined, {closeButton:false});
    win.margins = 10;
    win.orientation = "column";
    win.alignChildren = "center";
    if(bgcolor==="white"){
        win.graphics.backgroundColor = win.graphics.newBrush (win.graphics.BrushType.SOLID_COLOR, [1.0, 1.0, 1.0]);
    }
    // Dialog Width To Be Defined:
    var w_width = 450;  
    //  80 below is somewhat arbitrary. Run the script and see where the first line ends. Adjust w_static text to a bit longer than that. Uncomment the line below to get the text length, Use that in the "if" statement.
    //alert (message.length)
    if (message.length < 80 && message.indexOf("\r")===-1 && message.indexOf("\n")===-1) {
    // single line
         var msg = win.add('statictext', undefined, message);
    }
    else{
    // multiline    
        var msg = win.add('statictext', undefined, 'X', {multiline: true});
        // if not using standard font size, Font must be defined below, even if using set_font, or the message will truncate unpredictably.
        msg.graphics.font="Tahoma:14";        
        
        var X_width = msg.preferredSize[0];
        with(msg){preferredSize = [-1,-1]; characters = ~~(w_width/X_width); preferredSize[1] = -1;};
        msg.text = message;
    }
    var btn = win.add("button", undefined, "OK",{name: "ok"});      
    var cancelled = false;
    // Function for button click
    btn.onClick = function () {
        cancelled = true;
        OktoResume = true;
        win.close();
        $.writeln("User clicked OK");
    }
    // Show the window
 //   set_font (win, "Tahoma:14");
    win.show();  
} // end alertPallette

I haven't tested it and proably won't, but I think there is a good chance that might work.

 

Translate
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 ,
May 08, 2025 May 08, 2025
LATEST

Just tested it, it doesn't really work. It does work in the sense that the script doesn't proceed until you click OK on the second pop-up, but the script is still running in the background so you can't do anything in FM. (Basically, it locked up FM and I had to close and restart it).

 

I tried this:

while (OktoResume ===false) {
     $.sleep(2000);
    if (OktoResume===true) {            
        break;
    } 
}

The way I thought that would work is the script would sleep for 2 seconds, check if the variable had changed, then sleep for another two seconds.

 

It worked as I expected for the first two seconds, then the Spell Checker pod turned black and I had to close are re-open FM again.

Translate
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