Sync CafeTran with Word
Thread poster: 2nl (X)
2nl (X)
2nl (X)  Identity Verified
Netherlands
Local time: 19:28
Dec 7, 2014

Here is an AppleScript that syncs the content of the source segment box with the underlaying Word document. Whenever you move to the next segment, the source segment is found in the Word document:



Demonstration movie: https://www.youtube.com/watch?v=ZQai6NwtGxk

Solutions for Word for Windows are available too.


 
Selcuk Akyuz
Selcuk Akyuz  Identity Verified
Türkiye
Local time: 21:28
English to Turkish
+ ...
web resource Dec 7, 2014

Synchronisation with the source document, to see the context? What about saving the doc file as html and adding as a web resource in CafeTran?

It can be used for all Office formats. For pdf? Not sure. AFAIK pdf not supported in web resources. Saving a pdf as web page may work.


 
Michael Beijer
Michael Beijer  Identity Verified
United Kingdom
Local time: 18:28
Member (2009)
Dutch to English
+ ...
AutoHotkey script to automatically preview source document from inside CafeTran (updated) Dec 7, 2014

For all you Windows users out there, I created an AutoHotkey script to view your source document (for preview purposes) while translating in CafeTran. My script automatically selects the text in your current source segment (strips out any tags), switches to your source document (this is a Word document in this video, but PDFs work too; probably also Excel and PowerPoint) and finds the relevant location in the document. All you need to do is enter the relevant document name in the script by right... See more
For all you Windows users out there, I created an AutoHotkey script to view your source document (for preview purposes) while translating in CafeTran. My script automatically selects the text in your current source segment (strips out any tags), switches to your source document (this is a Word document in this video, but PDFs work too; probably also Excel and PowerPoint) and finds the relevant location in the document. All you need to do is enter the relevant document name in the script by right-clicking on the "DocPreview.ahk" icon in your taskbar prior to using it.

I made a video showing how it works: https://www.youtube.com/watch?v=x7f0UoveVBA&feature=youtu.be


; Copies selected text in current segment in CafeTran and runs search in source document
; (works with both PDFs and Word documents)
; Written by Michael Beijer
; http://www.beijerdeas.com
; Note1: Specify name of the .pdf or .docx prior to use by right-clicking on AHK script icon in taskbar
; Note2: Make sure to enable "Edit > Copy source segments to clipboard"
; (which ensures the current source segment text is always copied to the clipboard, without tags)

!p:: ; Shortcut: Alt+P

{
WinActivate, src.docx ; Change focus to source .pdf or .docx; enter name here
Send, ^f ; Open Find dialogue in source document (Ctrl+F)
Send, ^a ; Select any previous text in the Ctrl+F field (Ctrl+A)
Send, ^v ; Paste selected text over previous selection (Ctrl+V)
Send, {Enter} ; Press "Next" in the Ctrl+F dialogue
return

}


Michael
Collapse


 
2nl (X)
2nl (X)  Identity Verified
Netherlands
Local time: 19:28
TOPIC STARTER
SearchInPDF Dec 7, 2014

Chris Stone came with the solution for searching in PDF files, using Skim for OS X:

http://youtu.be/ziWoIvToWA0

set textToFind to get the clipboard
tell application "Skim"
set foundText to find front document text textToFind
select foundText with animation
end tell


 
Meta Arkadia
Meta Arkadia
Local time: 01:28
English to Indonesian
+ ...
It's even better Dec 8, 2014

By the looks of it, both the AHK and the Keyboard Maestro macro are CafeTran independent, so they can be used by all CAT tool users.

I don't know about AHK, but if 2nl would be kind enough to make the KBM macro available as AppleScript, all Macs can use it (click on “Or by script” at the top of the macro and click “Or by AppleScript”, Cmd-A, followed by Cmd-C in an AppleScript window, save script as applet, assign keyboard shortcut in Keyboard Preferences).
... See more
By the looks of it, both the AHK and the Keyboard Maestro macro are CafeTran independent, so they can be used by all CAT tool users.

I don't know about AHK, but if 2nl would be kind enough to make the KBM macro available as AppleScript, all Macs can use it (click on “Or by script” at the top of the macro and click “Or by AppleScript”, Cmd-A, followed by Cmd-C in an AppleScript window, save script as applet, assign keyboard shortcut in Keyboard Preferences).

And if you use Preview or File Viewer rather than Skim, you should be able to adjust the script in such way that you can also use it for all formats* that can be opened by those apps, including Office:mac files.

*for Preview, that's basically everything that can be viewed by Quick Look, File Viewer (free) even offers a few more formats.

Cheers,

Hans


[Edited at 2014-12-08 01:52 GMT]
Collapse


 
2nl (X)
2nl (X)  Identity Verified
Netherlands
Local time: 19:28
TOPIC STARTER
Turn hyphenation off Dec 9, 2014

In order to get the best results with this script, you should (ask your clients to) turn hyphenation off before the PDF is created. Skim cannot search across hyphenation marks.

 
2nl (X)
2nl (X)  Identity Verified
Netherlands
Local time: 19:28
TOPIC STARTER
There is a tool to remove the hyphens Dec 10, 2014

I just tested it and you can use Infix Pro to remove the hyphens.

From Inceni Support:

- Open the Preferences panel by selecting "Preferences" from the "File" menu item.

- Select the "Spelling" tab on the panel, change the spelling language to the language that the document is written in and ensure that the check box "Hyphenate words when editing" is unchecked.

- Press "OK" to save your changes.


Select one hyphen at line ending, plus the extra space. Then choose Find/Replace and insert the hypen plus space into the Find field. Leave the Replace field empty.

- Click on the blue underlined link next to the "Replace:" text field to open the "Replace Format" dialog. and change the "Reflow:" combo box from "Containing Line" to "Containing Paragraph".

- Click "OK" to save your changes.

- Click "Replace All" to start the find and replace.


You will get a copy of your PDF with the hyphens removed. Nice!


 
Meta Arkadia
Meta Arkadia
Local time: 01:28
English to Indonesian
+ ...
Tested Dec 11, 2014

And if you use Preview or File Viewer rather than Skim, you should be able to adjust the script in such way that you can also use it for all formats* that can be opened by those apps, including Office:mac files


I finally tested my original Automator Applet with .doc, .docx, .xlsx, and .pdf, of course. You can see an animated GIF of a search in a .doc file here: https://dl.dropboxusercontent.com/u/2184204/ProZ/Animated%20Search%20in%20Source.gif (way too big to post on this forum. 2 MB).

Prerequisites:
- the document should be opened in Preview. It seems all formats that can be previewed by Quick Look can be opened in Preview.
- you should enter any search term in Preview before your first search
- copy the search term to the ClipBoard (select, hit Cmd-C)

Then, either run the applet by clicking it (as in the animated GIF), or by hitting a keyboard shortcut, to be assigned in System Preference | Keyboard | Shortcuts | App Shortcuts.

Since this is a Clipboard script, rather than an app specific one, this should work for all documents you can open in Preview, and for a search from within all applications, including all CAT tools.



You can download the app here (Mac only, of course): https://www.dropbox.com/sh/y82xrblvgad3e2v/AADO-asZfGmZey_XLtwSQZ8ea?dl=0

Cheers,

Hans


 
2nl (X)
2nl (X)  Identity Verified
Netherlands
Local time: 19:28
TOPIC STARTER
Script doesn't work anymore after update of Word Dec 13, 2014

After updating Word to this week's build (14.4.7) the script doesn't work anymore. I'll try to find a solution for this. For the time being I'm saving my DOCX files (with hyphenation turned off!) as PDF files, since the FindInPDF script still works.

 
2nl (X)
2nl (X)  Identity Verified
Netherlands
Local time: 19:28
TOPIC STARTER
Script is fixed – syncing works again Feb 23, 2015

Please change the script to:



in order to making syncing with Word:mac 2011 14.4.8 again. I'm currently working on temporarily highlighting the found result in Word, since the normal blue selection disappears when Word loses focus.

Hans


[Edited at 2015-02-23 09:34 GMT]


 
Hans Lenting
Hans Lenting
Netherlands
Member (2006)
German to Dutch
Find Next in PDF Apr 20, 2022

2nl (X) wrote:

Chris Stone came with the solution for searching in PDF files, using Skim for OS X:

http://youtu.be/ziWoIvToWA0

set textToFind to get the clipboard
tell application "Skim"
set foundText to find front document text textToFind
select foundText with animation
end tell


Eight years later and I've found a way to use Find Next (find the next instance of a string in an opened PDF file):

Screen Shot 2022-04-20 at 08.56.46


 


To report site rules violations or get help, contact a site moderator:

Moderator(s) of this forum
Natalie[Call to this topic]

You can also contact site staff by submitting a support request »

Sync CafeTran with Word






TM-Town
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »
Trados Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

More info »