#cs Publisher 2016 scripts Publisher is the dumbest DTP program out there, and the most primitive. It has a few cool features, but they're not cool for translators. There is no way to import a translation. You can extract individual pages to HTML, and you can create a PDF and use OCR on it to generate plain text, but that's about it. == Pressing Ctrl+A in a text box or a cell will select all text in it. Character and line formatting does not survive a roundtrip via MS Word. If you paste into a cell, the pasted text will take on the cell's formatting, and if you find/replace any text, the replaced text will take on the found text's formatting. This excludes formatting within sentences, though (e.g. a single word in bolded). You can't find line breaks. So if the author used soft line breaks to format a sentence, you can only "find" the portion of text between those breaks, and not the entire sentence. I know of no keyboard shortcut that moves from one text box to another, but you can move from cell to cell with Tab and Shift+Tab. Pressing Tab too many times creates new rows, but pressing Shift-Tab too many times is harmless. == There are two ways of doing this: Scenario 1: as long as the right translation is in the right box. Use publisher_extract.au3 and publisher_paster.au3 Create a copy of the original file, named e.g. UPDATED. Use the UPDATED file to extract tables and non-tables. The extract script replaces table and non-table content with IDs, and the paste script replaces the IDs with the translated content. All formatting will be lost. The right content will be in the right box, but it won't be formatted correctly. Useful if your client says "I'll take care of the formatting, just you make sure the right text is in the right box". Scenario 2: try to retain formatting of text segments. Use publisher_extract.au3, publisher_paster.au3, and publisher_FR.au3 (still to be written) Create two copies of the original file, named e.g. TEMP and e.g. UPDATED. Use the TEMP file to extract non-tables and tables with problematic formatting. After extraction, delete the TEMP file. Use the UPDATED file to extract tables (and non-tables with unproblematic formatting). The extract script replaces extracted content in the UPDATED file with IDs, and the paste script replaces the IDs with the translated content. The content that was extracted from the TEMP file (which is still untranslated in the UPDATED file) will be replaced using a complicated and silly find/replace operation that can find/replace only portions of text between line breaks. I'll write this later, when I get a client that requires it. But essentially, you create a two column file with source text left and your translation right, and then after translation, you sort the source column by line length (long to short), and then you use Publisher's own find/replace operation to find each English chunk of text and replace it with its translation. So you see why this has to be done from long to short. == Scenario 1 extraction: 1 User clicks in a cell or box 2 User presses shortcut 3 Script generates unique number 4 Script does ^a, ^x, then pastes unique number 5 Script writes to a file similar to this: unique number [[copied text]] 6 Script presses Shift+Tab 7 Script does ^a, ^c again, and checks to see if it is an ID - if it is an ID, then it was the last cell, and the function stops - if it is not an ID, then repeat steps 3 to 7 Scenario 1 pasting: 1 Script does stringsplitting etc. . Script makes copy of TM file named e.g. CHECKED 2 Use a TranZvoo type of script. 3 User clicks in cell or box with ID 4 User presses shortcut 5 Script does ^a, ^c and looks up the translation 6 Script pastes translation 7 Script does F/R in CHECKED file to mark the TU as pasted (so that the user can check afterwards which TUs weren't pasted, if any). #ce Global $clippy MsgBox (0, "", "The shortcut is ` (box) or Ctrl+` (cell).", 0) $i = InputBox ("", "Start from what number ID", "1") HotKeySet("`", "ExtractText") HotKeySet("^`", "ExtractTextTable") $tmfile = FileOpen ("tmfile.txt", 129) $i = 0 While 1 Sleep(100) WEnd Func ExtractTextTable() While 1 Send ("^a") Sleep ("100") Send ("^c") Sleep ("100") $clippy = ClipGet () Sleep ("200") If StringInStr ($clippy, "{{{BOX:") Then Return EndIf If NOT StringRegExp ($clippy, "[A-Za-z]") = 1 Then Send ("+{TAB}") Sleep ("100") ContinueLoop EndIf $i = $i + 1 $boxid = "{{{BOX:" & $i & ":BOX}}}" ClipPut ($boxid) Sleep ("200") Send ("^v") FileWrite ($tmfile, @CRLF & $boxid & @CRLF & $clippy) Send ("+{TAB}") Sleep ("100") WEnd EndFunc Func ExtractText() Send ("^a") Sleep ("100") Send ("^c") Sleep ("100") $clippy = ClipGet () Sleep ("200") $i = $i + 1 $boxid = "{{{BOX:" & $i & ":BOX}}}" ClipPut ($boxid) Sleep ("200") Send ("^v") FileWrite ($tmfile, @CRLF & $boxid & @CRLF & $clippy) EndFunc