Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (34 sloc) 911 Bytes
/* :name=Open Project Folder :description=Open the project folder in the operating system
* Open project folder
* @author Yu Tang
* @date 2013-06-05
* @version 0.3
import static javax.swing.JOptionPane.*
import static org.omegat.util.Platform.*
// abort if a project is not opened yet
def prop = project.projectProperties
if (!prop) {
final def title = 'open project folder'
final def msg = 'Please try again after you open a project.'
showMessageDialog null, msg, title, INFORMATION_MESSAGE
// get command GString to open a folder
def folder = prop.projectRoot
def command
switch (osType) {
case [OsType.WIN64, OsType.WIN32]:
command = "explorer.exe \"$folder\""
case [OsType.MAC64, OsType.MAC32]:
command = ['open', folder]
default: // for Linux or others
command = ['xdg-open', folder]
// open it
You can’t perform that action at this time.