Scripting error: write_notes.groovy Inițiatorul discuției: Kepler Lee
| Kepler Lee Taiwan Local time: 04:17 din engleză în chineză + ...
A groovy (write_notes) downloaded from "http://wp.me/p3fHEs-9N" works well in OmegaT 3.5.2 version originally. However, when I install and run 3.5.3 version, this script (and some other scripts, such as write_table.groovy from http://wp.me/p3fHEs-7L) can not work well now. Initially, the 3.5.3 version without attached JRE is installed (I do so because I think that JRE already exists in 3.5.2 ve... See more A groovy (write_notes) downloaded from "http://wp.me/p3fHEs-9N" works well in OmegaT 3.5.2 version originally. However, when I install and run 3.5.3 version, this script (and some other scripts, such as write_table.groovy from http://wp.me/p3fHEs-7L) can not work well now. Initially, the 3.5.3 version without attached JRE is installed (I do so because I think that JRE already exists in 3.5.2 version, there is no need to reinstall JRE). In this morning, I download and install the 3.5.3 version with attached JRE and try again. The situation remains without change. Is there any solution? Alternatively, is there any safe method to go back to run 3.5.2 version without losing my current settings? The message of running the script is as following: The script "E:\MyDocument\翻譯語言\0CAT\OmegaT\Scripts\write_notes.groovy" is running... An error occurred javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: static org.omegat.util.StaticUtils.makeValidXML() is applicable for argument types: (java.lang.String) values: [V-groves:V-grooves:已改] In case the groovy cannot be downloaded, refer to the following pasted code. /* THIS SCRIPT HAS BEEN SPONSORED BY TRANSLATION AGENCY VELIOR [ http://velior.ru ] * * #Purpose: Export the project into a HTML table * #Files: Writes 'project_table.html' in the 'script_output' subfolder * of current project's root. Each source file is exported to a separate * table that has the name of the file as its heading, all source segments * in the left column and corresponding target segments in the right. * #Details: http://wp.me/p3fHEs-7L * * @author: Kos Ivantsov * @date: 2014-01-16 * @version: 0.2 */ import static javax.swing.JOptionPane.* import static org.omegat.util.Platform.* import org.omegat.util.StaticUtils def prop = project.projectProperties if (!prop) { final def title = 'Export project to table' final def msg = 'Please try again after you open a project.' showMessageDialog null, msg, title, INFORMATION_MESSAGE return } def folder = prop.projectRoot+'script_output/' projname = new File(prop.getProjectRoot()).getName() table_file = new File(folder + projname + '.html') // create folder if it doesn't exist if (! (new File (folder)).exists()) { (new File(folder)).mkdir() } count = 0 table_file.write("""\ \n """, 'UTF-8') files = project.projectFiles for (i in 0 ..< files.size()) { fi = files[i] table_file.append("""\ $fi.filePath\n""", 'UTF-8') for (j in 0 ..< fi.entries.size()) { ste = fi.entries[j] source = ste.getSrcText() target = project.getTranslationInfo(ste) ? project.getTranslationInfo(ste).translation : null; if (target == null) target = "zzznullzzz" if (target.size() == 0 ) target = "" source = StaticUtils.makeValidXML(source) target = StaticUtils.makeValidXML(target).replaceAll(/zzznullzzz/, //) table_file.append("""\ $source $target""", 'UTF-8') count++ } table_file.append(" \n", 'UTF-8') } table_file.append("\n", 'UTF-8') console.println "$count segments written to $table_file" ▲ Collapse | | | Susan Welsh Statele Unite Local time: 16:17 din rusă în engleză + ... | Didier Briel Franţa Local time: 22:17 din engleză în franceză + ... | Kepler Lee Taiwan Local time: 04:17 din engleză în chineză + ... INIŢIATORUL SUBIECTULUI
Thank Didier for the direct link! The script works after modification. Thank Susan for the good group message! I made registration few minutes ago. | |
|
|
Samuel Murray Ţările de Jos Local time: 22:17 Membru (2006) din engleză în afrikaans + ...
Essentially, change "StaticUtils" into "StringUtil" everywhere in the script. | | | Pentru acest forum nu a fost numit niciun moderator. Pentru a raporta încălcarea regulilor site-ului sau pentru a solicita asistență, vă rugăm să contactați personalul site-ului » Scripting error: write_notes.groovy Wordfast Pro | Translation Memory Software for Any Platform
Exclusive discount for ProZ.com users!
Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value
Buy now! » |
| Protemos translation business management system | Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!
The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.
More info » |
|
| | | | X Sign in to your ProZ.com account... | | | | | |