Skip to main content
Known Participant
October 19, 2024
Question

表内の単語の行送りの見つけ方について

  • October 19, 2024
  • 4 replies
  • 1732 views

こんにちは
いつもお世話になっております
連続投稿すみません。

DTP業務で、日本語.fmデータ → XML → 翻訳ツール → XML → 英語.fmデータの工程で英文マニュアルを作成しています。
その際にTable困ったことがあって、ここに投稿させていただきました。

困りごとと言うのは添付ファイルのように日本語はテキスト数が少ないが、英文に翻訳されるとテキスト数が多くなり、Table内のテキストが行送りされてしまいます。

取引先に納品する際に、何百ページあるものをすべて目で確認して、行送りされている箇所があれば、表の列幅を広がて単語が行送りされないようにしています。(何十時間もかかっています)
そこでお聞きしたいのですが、行送りされたものを強調表示させる既存機能はないでしょうか
よろしくお願いします

    This topic has been closed for replies.

    4 replies

    Participating Frequently
    October 25, 2024

    こんにちは

    調べるドキュメントを開いた状態で次のスクリプトを実行してみてください。

    単語が分割されたとみなせるセルを赤色にします。

    実行直後は色が反映されないので、CTRL+Lでリフレッシュしてください。

    それではよい週末を!

    var docObj = app.ActiveDoc;
    var flow = docObj.MainFlowInDoc;
    var tblAnchors = flow.GetText (Constants.FTI_TblAnchor);
    for (var i=0;i<tblAnchors.length;i++){
        var tbl = tblAnchors[i].obj;
        var row = tbl.FirstRowInTbl;
        var cell = row.FirstCellInRow;
        while (cell.ObjectValid()){
            var flag = false;
            var pgf = cell.FirstPgf;
            while (pgf.ObjectValid()){
                var textItems = pgf.GetText (Constants.FTI_String);
                for (var j=0;j<textItems.length-1;j++){
                    // セル内の行末がスペースかスラッシュで終わっているか、正規表現でチェックする
                    //正規表現は行末に入ってもエラーとしない文字です。必要に応じて書き換えてください
                    var r = textItems[j].sdata.match (/[\s\/]$/);
                    if (r==null){
                        flag = true;
                        break;
                    }
                }
                if (pgf.Unique == cell.LastPgf.Unique){
                    break;
                }
                pgf = pgf.NextPgfInFlow;
            }
            if (flag){
                //行末にスペースかスラッシュを含まない段落があるセルの色を赤にする
                //色名は必要に応じて書き換えてください
                cell.CellOverrideShading = docObj.GetNamedColor ("赤");
                cell.CellUseOverrideShading  = true;
                cell.CellOverrideFill = Constants.FV_FILL_BLACK;
                cell.CellUseOverrideFill = true;
            }
            cell = cell.NextCellInTbl;
        }
    }

     

    geso10Author
    Known Participant
    October 25, 2024

    yataniさん

    こんにちは。

    先日は、イラスト名常駐スクリプトありがとうございました。

     

    今回は、半ば諦めていたところスクリプトをご提供いただきありがとうございます。

    来週実施してみたいと思います。

    重ねてになりますがありがとうございました。

     

    Barb Binder
    Community Expert
    Community Expert
    October 21, 2024

    Hi @geso10:

     

    Rick's (@frameexpert) targets the column widths and not the word break issue. Since you mentioned that you are looking for the word break problem and then widening the columns to fix it, I suggested the script.

     

    However, I'm now questioning my suggestion because it will make the columns wide enough for the longest entry to fit on one line and not just wide enough to keep the word from breaking in the wrong place.

     

    ~Barb

    ~Barb at Rocky Mountain Training
    geso10Author
    Known Participant
    October 22, 2024

    こんにちは。

    ご提案いただきありがとうございます。

    行送りされている箇所を特定することに特化したものがないかご相談したかったです。

    Barb Binder
    Community Expert
    Community Expert
    October 20, 2024
    quote

    I widen the column width of the table...


    By @geso10

     

    If that is the solution, you can select a problem column and choose Table > Resize Columns > To the Width of Selected Cell's Contents. You only shared one example, but noted this happens quite a bit. @frameexpert has a script that can apply this to multiple tables at one time—see Table Cleaner here: https://www.frameexpert.com/store/index.html.

     

    If this script doesn't do what you want, Rick may be able to write a custom script for you.

     

    ~Barb

    ~Barb at Rocky Mountain Training
    geso10Author
    Known Participant
    October 21, 2024

    こんにちは
    いつもお世話になっています
    ありがとうございます

    ご紹介いただいたhttps://www.frameexpert.com/store/index.html.を確認させていただきましたが、少し用途が違うようです。
    やっぱり、単語の行送りのみを強調表示するようなことは難しいのでしょうか

    Community Expert
    October 19, 2024

    Hi -. You can work with the tightness of word hyphenation in the paragraph designer. Have you changed the language settings to English in the translated text?

     

     

    Bjørn Smalbro - FrameMaker.dk
    geso10Author
    Known Participant
    October 19, 2024

    こんにちは。

    ご返事ありがとうございます。

     

    フォントの言語は「英語」になっています。

    また、取引先のルールでハイフネーションは、禁止せれているので、単語で行送りされたものを一つ一つ探しているのが現状です。

    列幅が狭く、スペースで区切れない単語が添付の黄色マーカーのようになるのだと理解しています。

    スペースの無い行を探すスクリプトは実現できますでしょうか?