Menu

Setting the Scripts Folder in Mac Log in to Edit

Héctor Cartagena

Problem

You have installed OmegaT in your Mac and now you want to use one of the scripts in Tools > Scripting, but the list is empty. So, you go to File > Set Scripts Folder and try to navigate to OmegaT's installation folder, but you can't find it.

Reason

In Mac, OmegaT's installation folder is not accessible through the scripting window's dialog box. However, it is accessible from Finder. The actual location will depend on how you installed OmegaT. If you followed the installation instructions, it will be somewhere within the Applications folder.

IMPORTANT: OmegaT can be run from any folder in your system, so if you unzipped it in the Downloads folder and haven't moved it from there... well, it is there. If you are not careful, you may end up with several copies in different places. In this article, we will make three assumptions:

  1. that you have followed the installation instructions
  2. that there is only one copy of OmegaT in your system
  3. that anything you download goes by default to your Downloads folder

Solution

Before you start, make sure to close any OmegaT session currently open. Then, proceed to any of the two solutions provided below.

Option 1: Using a Shell Script

Manuel Souto Pico kindly contributed with a customization script that the author of this article modified to help Mac users automatically set the scripts folder. You can download it from here. After downloading, do this:

  1. Press command+spacebar to open a Spotlight search and type Terminal.
  2. Double click on the search result. This will open a Terminal session.
  3. In Terminal, type cd ~/Downloads
  4. Then, type chmod a+x omtmac_scripting.sh
  5. Finally, type ./omtmac_scripting.sh
  6. Close the Terminal sesion.

Note: Instead of typing, you can copy and paste from the steps above.
Screenshot of a Terminal session
Now, go to the Confirmation step below.

Option 2: Manually Setting the Scripts Folder

First, you need to get the pathname of your OmegaT installation. You can start from the Dock or, if you don't see the OmegaT icon there, from Finder.

Step No. From the Dock: From Finder:
1. control+click on the OmegaT icon Put the cursor in the Search field
2. Click on Options Type omegat.app and hit return (enter).
3. Click on Show in Finder and proceed to the steps below. Select "This Mac" in the Search scope bar and proceed to the steps below.

Now you are able to copy the pathname of your OmegaT installation:

  1. Control+click on OmegaT to show the context menu.
  2. Press and hold option (alt) .
  3. SelectCopy "OmegaT" as Pathname .
    Screenshot from Finder showing context menu
    Next, you need to access OmegaT's configuration folder.

  4. Press command+space to open Spotlight Search and type OmegaT.

  5. Double click on the search result. This will open an OmegaT session.
  6. Go to Options > Access Configuration Folder. This will open OmegaT's configuration folder in Finder.

In Finder, look for omegat.prefs in the file list.

Note: Before you proceed, you may want to create a backup of this file. To create a backup of omegat.prefs, control+click on it and select Duplicate in the context menu.
Screenshot from Finder showing OmegaT's configuration folder
When you are ready, control+click on omegat.prefs and select Open With and then TextEdit.

A TextEdit window will open showing the contents of omegat.prefs. In TextEdit, do the following:

  1. Press command+F to show the search field on top of the window.
  2. In the search field, type scripts_dir. You should see a results count of 2 on the right.
  3. Scroll down to see the highlighted result. It should be a line with this code: <scripts_dir>scripts</scripts_dir>
    Screenshot from TextEdit showing the search results
  4. Double click on the word "scripts" betwen the "><" brackets to select it.
  5. Press command+V to paste the OmegaT pathname you copied from Finder above.
  6. Complete the path by appending this string after "Omegat.app": /Contents/Java/scripts
    Screenshot from TextEdit showing Script folder settings
  7. Press command+S to save your changes.

Confirmation

Check that you have successfully set the scripts folder by going to OmegaT > Tools > Scripting. You should be able to see the list of scripts in the right pane.


Related

Wiki: Home
Wiki: Scripts

Discussion

  • Héctor Cartagena

    Screenshot from Terminal.

     

    Last edit: Héctor Cartagena 2020-05-09
  • Héctor Cartagena

    Screenshot from Finder showing "Copy "OmegaT" as Pathname".

     
  • Héctor Cartagena

    Screenshot from Finder showing omegat.prefs

     
  • Héctor Cartagena

    Screenshot from TextEdit showing the search results.

     
  • Héctor Cartagena

    Screenshot from TextEdit showing the Scripts folder setting.

     

Log in to post a comment.