Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //define full path to OTStats if it's not in the $PATH
- otstats = 'OTStats'
- import static javax.swing.JOptionPane.*
- import static org.omegat.util.Platform.*
- sys = System.getProperty("os.name")
- if (sys != 'Linux'){
- final def title = 'Run OTStats'
- final def msg = 'This script is intended for GNU/Linux only.'
- console.print "\n*****\n$msg"
- showMessageDialog null, msg, title, INFORMATION_MESSAGE
- return
- }
- prop = project.getProjectProperties()
- if (!prop) {
- final def title = 'Run OTStats'
- final def msg = 'Please try again after you open a project.'
- console.println "\n*****\n$msg"
- showMessageDialog null, msg, title, INFORMATION_MESSAGE
- return
- }
- folder = System.getProperty('user.home')+'/.OTStats/'
- writefile = new File(folder+'root.ini')
- if (! (new File(folder)).exists()) {
- (new File(folder)).mkdir()
- }
- projroot = prop.getProjectRoot()
- folders = projroot.tokenize('/')
- current_folder = folders[folders.size()-1].toString()
- writefile.write("${projroot - current_folder - '//'}", 'UTF8')
- [otstats, current_folder].execute()
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement