This site uses cookies.
Some of these cookies are essential to the operation of the site,
while others help to improve your experience by providing insights into how the site is being used.
For more information, please see the ProZ.com privacy policy.
use AppleScript version "2.4" -- Yosemite (10.10) or later use framework "Foundation" use scripting additions
set theLangs to {} tell application id "com.apple.iWork.Pages" -- Pages tell document 1 set theParagraphs to paragraphs of body text repeat with i from (count of theParagraphs) to 1 by -1 if length of item i of theParagraphs > 1 then set theLanguage to (my guessLanguageOf:(item i of theParagraphs)) -- will be "en", "de", etc if theLanguage = "en" then delete paragraph i of body text end if end if end repeat end tell end tell
on guessLanguageOf:theString set theTagger to current application's NSLinguisticTagger's alloc()'s initWithTagSchemes:{current application's NSLinguisticTagSchemeLanguage} options:0 theTagger's setString:theString set languageID to theTagger's tagAtIndex:0 |scheme|:(current application's NSLinguisticTagSchemeLanguage) tokenRange:(missing value) sentenceRange:(missing value) return languageID as text end guessLanguageOf:
BTW: Sometimes you want to KEEP paragraphs in a certain language, e.g. German.
Change the equals sign to the ≠ (not equal to) in:
Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.
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.